#include "components/metrics/structured/lib/key_data_file_delegate.h"
#include <utility>
#include "base/files/file_path.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/sequence_checker.h"
#include "base/task/bind_post_task.h"
#include "base/task/sequenced_task_runner.h"
#include "base/time/time.h"
#include "components/metrics/structured/lib/histogram_util.h"
#include "components/metrics/structured/lib/key_util.h"
#include "components/metrics/structured/lib/persistent_proto.h"
#include "components/metrics/structured/lib/proto/key.pb.h"
namespace metrics::structured {
KeyDataFileDelegate::KeyDataFileDelegate(
const base::FilePath& path,
base::TimeDelta save_delay,
base::OnceClosure on_initialized_callback)
: … { … }
KeyDataFileDelegate::~KeyDataFileDelegate() = default;
bool KeyDataFileDelegate::IsReady() const { … }
const KeyProto* KeyDataFileDelegate::GetKey(uint64_t project_name_hash) const { … }
void KeyDataFileDelegate::UpsertKey(uint64_t project_name_hash,
base::TimeDelta last_key_rotation,
base::TimeDelta key_rotation_period) { … }
void KeyDataFileDelegate::Purge() { … }
void KeyDataFileDelegate::OnRead(ReadStatus status) { … }
void KeyDataFileDelegate::OnWrite(WriteStatus status) { … }
void KeyDataFileDelegate::WriteNowForTesting() { … }
}