#include "components/metrics/environment_recorder.h"
#include "base/base64.h"
#include "base/hash/sha1.h"
#include "base/strings/string_number_conversions.h"
#include "components/metrics/metrics_pref_names.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "third_party/metrics_proto/system_profile.pb.h"
namespace metrics {
namespace {
std::string ComputeSHA1(const std::string& data) { … }
}
EnvironmentRecorder::EnvironmentRecorder(PrefService* local_state)
: … { … }
EnvironmentRecorder::~EnvironmentRecorder() = default;
std::string EnvironmentRecorder::SerializeAndRecordEnvironmentToPrefs(
const SystemProfileProto& system_profile) { … }
bool EnvironmentRecorder::LoadEnvironmentFromPrefs(
SystemProfileProto* system_profile) { … }
void EnvironmentRecorder::ClearEnvironmentFromPrefs() { … }
int64_t EnvironmentRecorder::GetLastBuildtime() { … }
std::string EnvironmentRecorder::GetLastVersion() { … }
void EnvironmentRecorder::SetBuildtimeAndVersion(int64_t buildtime,
const std::string& version) { … }
void EnvironmentRecorder::RegisterPrefs(PrefRegistrySimple* registry) { … }
}