chromium/components/metrics/structured/lib/event_buffer.h

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_METRICS_STRUCTURED_LIB_EVENT_BUFFER_H_
#define COMPONENTS_METRICS_STRUCTURED_LIB_EVENT_BUFFER_H_

#include <concepts>
#include <type_traits>

#include "base/files/file_path.h"
#include "base/functional/callback.h"
#include "base/time/time.h"
#include "base/types/expected.h"
#include "components/metrics/structured/lib/resource_info.h"
#include "third_party/protobuf/src/google/protobuf/message_lite.h"

namespace metrics::structured {
// The result of adding an event to a buffer.
enum class Result {};

// Errors of flushing a buffer to disk.
enum FlushError {};

// Represents a flushed buffer.
struct FlushedKey {};

FlushedCallback;

// Abstraction for how in-memory events are managed on device.
template <typename T>
  requires(std::derived_from<T, google::protobuf::MessageLite>)
class EventBuffer {};

}  // namespace metrics::structured

#endif  // COMPONENTS_METRICS_STRUCTURED_LIB_EVENT_BUFFER_H_