chromium/chrome/browser/safe_browsing/extension_telemetry/extension_telemetry_persister.cc

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

#include "chrome/browser/safe_browsing/extension_telemetry/extension_telemetry_persister.h"

#include <sstream>

#include "base/files/file_util.h"
#include "base/functional/callback.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/path_service.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/bind_post_task.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_paths.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"

namespace safe_browsing {

namespace {

WriteReportTrigger;

// If a file is older than `kMaxFileAge` it will be deleted instead
// of read.
constexpr base::TimeDelta kMaxFileAge =;
// The initial index for the `read_index_` and the `write_index_`.
constexpr int kInitialWriteIndex =;
constexpr int kInitialReadIndex =;
constexpr char kPersistedFileNamePrefix[] =;
// `kMaxCacheSize` is based off of a 12 hour reporting interval with a 15
// minute write interval. This value is used to size the UMA metric,
// there are no plans for the persister to have a cache this large.
constexpr int kMaxCacheSize =;

void RecordWriteResult(bool success, WriteReportTrigger trigger) {}

void RecordReadResult(bool success) {}

void RecordPersistedFileSize(size_t size) {}

void RecordNumberOfFilesInCacheOnStartup(int cache_size) {}

void RecordAgedFileFound(bool found) {}
}  // namespace

ExtensionTelemetryPersister::~ExtensionTelemetryPersister() = default;

ExtensionTelemetryPersister::ExtensionTelemetryPersister(
    int max_num_files,
    base::FilePath profile_path)
    :{}

void ExtensionTelemetryPersister::PersisterInit() {}

void ExtensionTelemetryPersister::WriteReport(const std::string write_string,
                                              WriteReportTrigger trigger) {}

std::string ExtensionTelemetryPersister::ReadReport() {}

void ExtensionTelemetryPersister::ClearPersistedFiles() {}

int ExtensionTelemetryPersister::MaxFilesSupported() {}

bool ExtensionTelemetryPersister::DeleteFile(const base::FilePath path) {}
}  // namespace safe_browsing