#include "components/download/internal/background_service/logger_impl.h"
#include <memory>
#include "base/i18n/time_formatting.h"
#include "base/observer_list.h"
#include "base/values.h"
#include "components/download/internal/background_service/driver_entry.h"
#include "components/download/internal/background_service/entry.h"
#include "components/download/internal/background_service/log_source.h"
#include "components/download/public/background_service/clients.h"
#include "components/download/public/background_service/download_params.h"
namespace download {
namespace {
std::string ControllerStateToString(Controller::State state) { … }
std::string OptBoolToString(std::optional<bool> value) { … }
std::string EntryStateToString(Entry::State state) { … }
std::string DriverEntryStateToString(DriverEntry::State state) { … }
std::string CompletionTypeToString(CompletionType type) { … }
std::string StartResultToString(DownloadParams::StartResult result) { … }
base::Value::Dict DriverEntryToValue(const DriverEntry& entry) { … }
base::Value::Dict EntryToValue(
const Entry& entry,
const std::optional<DriverEntry>& driver,
const std::optional<CompletionType>& completion_type) { … }
}
LoggerImpl::LoggerImpl() : … { … }
LoggerImpl::~LoggerImpl() = default;
void LoggerImpl::SetLogSource(LogSource* log_source) { … }
void LoggerImpl::AddObserver(Observer* observer) { … }
void LoggerImpl::RemoveObserver(Observer* observer) { … }
base::Value::Dict LoggerImpl::GetServiceStatus() { … }
base::Value::List LoggerImpl::GetServiceDownloads() { … }
void LoggerImpl::OnServiceStatusChanged() { … }
void LoggerImpl::OnServiceDownloadsAvailable() { … }
void LoggerImpl::OnServiceDownloadChanged(const std::string& guid) { … }
void LoggerImpl::OnServiceDownloadFailed(CompletionType completion_type,
const Entry& entry) { … }
void LoggerImpl::OnServiceRequestMade(
DownloadClient client,
const std::string& guid,
DownloadParams::StartResult start_result) { … }
}