#include "chrome/browser/notifications/scheduler/internal/icon_store.h"
#include <map>
#include <utility>
#include "base/containers/contains.h"
#include "base/uuid.h"
#include "chrome/browser/notifications/scheduler/internal/icon_entry.h"
#include "chrome/browser/notifications/scheduler/internal/proto_conversion.h"
#include "chrome/browser/notifications/scheduler/internal/stats.h"
#include "chrome/browser/notifications/scheduler/public/notification_scheduler_types.h"
namespace leveldb_proto {
void DataToProto(notifications::IconEntry* icon_entry,
notifications::proto::Icon* proto) { … }
void ProtoToData(notifications::proto::Icon* proto,
notifications::IconEntry* icon_entry) { … }
}
namespace notifications {
namespace {
bool HasKeyInDb(const std::vector<std::string>& key_dict,
const std::string& key) { … }
}
KeyEntryPair;
KeyEntryVector;
KeyVector;
IconProtoDbStore::IconProtoDbStore(
std::unique_ptr<leveldb_proto::ProtoDatabase<proto::Icon, IconEntry>> db,
std::unique_ptr<IconConverter> icon_converter)
: … { … }
IconProtoDbStore::~IconProtoDbStore() = default;
void IconProtoDbStore::InitAndLoadKeys(InitAndLoadKeysCallback callback) { … }
void IconProtoDbStore::AddIcons(IconTypeBundleMap icons, AddCallback callback) { … }
void IconProtoDbStore::LoadIcons(const std::vector<std::string>& keys,
LoadIconsCallback callback) { … }
void IconProtoDbStore::DeleteIcons(const std::vector<std::string>& keys,
UpdateCallback callback) { … }
void IconProtoDbStore::OnDbInitialized(
InitAndLoadKeysCallback callback,
leveldb_proto::Enums::InitStatus status) { … }
void IconProtoDbStore::OnIconKeysLoaded(InitAndLoadKeysCallback callback,
bool success,
LoadedIconKeys loaded_keys) { … }
void IconProtoDbStore::OnIconEntriesLoaded(
LoadIconsCallback callback,
bool success,
std::unique_ptr<std::map<std::string, IconEntry>> icon_entries) { … }
void IconProtoDbStore::OnIconsEncoded(
AddCallback callback,
std::vector<IconType> icons_type,
std::vector<std::string> icons_uuid,
std::unique_ptr<EncodeResult> encode_result) { … }
void IconProtoDbStore::OnIconsDecoded(
LoadIconsCallback callback,
std::vector<std::string> icons_uuid,
std::unique_ptr<DecodeResult> decoded_result) { … }
}