#include "components/feature_engagement/internal/persistent_availability_store.h"
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/logging.h"
#include "components/feature_engagement/internal/proto/availability.pb.h"
#include "components/feature_engagement/internal/stats.h"
#include "components/feature_engagement/public/feature_list.h"
#include "components/leveldb_proto/public/proto_database.h"
namespace feature_engagement {
namespace {
KeyAvailabilityPair;
KeyAvailabilityList;
void OnDBUpdateComplete(
std::unique_ptr<leveldb_proto::ProtoDatabase<Availability>> db,
PersistentAvailabilityStore::OnLoadedCallback on_loaded_callback,
std::unique_ptr<std::map<std::string, uint32_t>> feature_availabilities,
bool success) { … }
void OnDBLoadComplete(
std::unique_ptr<leveldb_proto::ProtoDatabase<Availability>> db,
FeatureVector feature_filter,
PersistentAvailabilityStore::OnLoadedCallback on_loaded_callback,
uint32_t current_day,
bool success,
std::unique_ptr<std::vector<Availability>> availabilities) { … }
void OnDBInitComplete(
std::unique_ptr<leveldb_proto::ProtoDatabase<Availability>> db,
FeatureVector feature_filter,
PersistentAvailabilityStore::OnLoadedCallback on_loaded_callback,
uint32_t current_day,
leveldb_proto::Enums::InitStatus status) { … }
}
void PersistentAvailabilityStore::LoadAndUpdateStore(
const base::FilePath& storage_dir,
std::unique_ptr<leveldb_proto::ProtoDatabase<Availability>> db,
FeatureVector feature_filter,
PersistentAvailabilityStore::OnLoadedCallback on_loaded_callback,
uint32_t current_day) { … }
}