#include "components/reporting/health/health_module_files.h"
#include <algorithm>
#include <memory>
#include <string>
#include <utility>
#include "base/files/file.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/types/expected.h"
#include "base/types/expected_macros.h"
#include "components/reporting/util/reporting_errors.h"
#include "third_party/re2/src/re2/re2.h"
namespace reporting {
std::unique_ptr<HealthModuleFiles> HealthModuleFiles::Create(
const base::FilePath& directory,
std::string_view file_base_name,
const uint32_t max_storage_space) { … }
HealthModuleFiles::HealthModuleFiles(
const base::FilePath& directory,
std::string_view file_base_name,
uint32_t max_storage_space,
uint32_t storage_used,
uint32_t max_file_header,
const std::map<uint32_t, base::FilePath>& files)
: … { … }
HealthModuleFiles::~HealthModuleFiles() = default;
base::FilePath HealthModuleFiles::CreateNewFile() { … }
void HealthModuleFiles::DeleteOldestFile() { … }
void HealthModuleFiles::PopulateHistory(ERPHealthData* data) const { … }
Status HealthModuleFiles::Write(std::string_view data) { … }
Status HealthModuleFiles::FreeStorage(uint32_t storage) { … }
Status HealthModuleFiles::ReserveStorage(uint32_t storage) { … }
StatusOr<uint32_t> HealthModuleFiles::FileSize(
const base::FilePath& file_path) { … }
}