#include "components/download/internal/background_service/download_store.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "components/download/internal/background_service/entry.h"
#include "components/download/internal/background_service/proto/entry.pb.h"
#include "components/download/internal/background_service/proto_conversions.h"
#include "components/leveldb_proto/public/proto_database_provider.h"
namespace download {
namespace {
KeyVector;
ProtoEntryVector;
KeyProtoEntryVector;
leveldb_env::Options GetDownloadDBOptions() { … }
}
DownloadStore::DownloadStore(
std::unique_ptr<leveldb_proto::ProtoDatabase<protodb::Entry>> db)
: … { … }
DownloadStore::~DownloadStore() = default;
bool DownloadStore::IsInitialized() { … }
void DownloadStore::Initialize(InitCallback callback) { … }
void DownloadStore::HardRecover(StoreCallback callback) { … }
void DownloadStore::OnDatabaseInited(InitCallback callback,
leveldb_proto::Enums::InitStatus status) { … }
void DownloadStore::OnDatabaseLoaded(InitCallback callback,
bool success,
std::unique_ptr<ProtoEntryVector> protos) { … }
void DownloadStore::OnDatabaseDestroyed(StoreCallback callback, bool success) { … }
void DownloadStore::OnDatabaseInitedAfterDestroy(
StoreCallback callback,
leveldb_proto::Enums::InitStatus status) { … }
void DownloadStore::Update(const Entry& entry, StoreCallback callback) { … }
void DownloadStore::Remove(const std::string& guid, StoreCallback callback) { … }
}