#include "components/autofill/core/browser/strike_databases/strike_database_integrator_base.h"
#include <algorithm>
#include <string>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/metrics/histogram_functions.h"
#include "base/time/time.h"
#include "components/autofill/core/browser/proto/strike_data.pb.h"
#include "components/autofill/core/common/autofill_clock.h"
#include "components/leveldb_proto/public/proto_database_provider.h"
namespace autofill {
StrikeDatabaseIntegratorBase::StrikeDatabaseIntegratorBase(
StrikeDatabaseBase* strike_database)
: … { … }
StrikeDatabaseIntegratorBase::~StrikeDatabaseIntegratorBase() = default;
StrikeDatabaseIntegratorBase::StrikeDatabaseDecision
StrikeDatabaseIntegratorBase::GetStrikeDatabaseDecision(
const std::string& id) const { … }
StrikeDatabaseIntegratorBase::StrikeDatabaseDecision
StrikeDatabaseIntegratorBase::GetStrikeDatabaseDecision() const { … }
bool StrikeDatabaseIntegratorBase::ShouldBlockFeature(
const std::string& id) const { … }
bool StrikeDatabaseIntegratorBase::ShouldBlockFeature() const { … }
int StrikeDatabaseIntegratorBase::AddStrike(const std::string& id) { … }
int StrikeDatabaseIntegratorBase::AddStrikes(int strikes_increase,
const std::string& id) { … }
int StrikeDatabaseIntegratorBase::RemoveStrike(const std::string& id) { … }
int StrikeDatabaseIntegratorBase::RemoveStrikes(int strike_decrease,
const std::string& id) { … }
int StrikeDatabaseIntegratorBase::GetStrikes(const std::string& id) const { … }
void StrikeDatabaseIntegratorBase::ClearStrikes(const std::string& id) { … }
void StrikeDatabaseIntegratorBase::ClearAllStrikes() { … }
size_t StrikeDatabaseIntegratorBase::CountEntries() const { … }
void StrikeDatabaseIntegratorBase::LimitNumberOfStoredEntries() { … }
bool StrikeDatabaseIntegratorBase::NumberOfEntriesExceedsLimits() const { … }
void StrikeDatabaseIntegratorBase::RemoveExpiredStrikes() { … }
void StrikeDatabaseIntegratorBase::ClearStrikesByIdMatching(
const std::set<std::string>& ids_to_delete,
base::FunctionRef<std::string(const std::string&)> id_map) { … }
void StrikeDatabaseIntegratorBase::ClearStrikesByIdMatchingAndTime(
const std::set<std::string>& ids_to_delete,
base::Time delete_begin,
base::Time delete_end,
base::FunctionRef<std::string(const std::string&)> id_map) { … }
void StrikeDatabaseIntegratorBase::ClearStrikesForKeys(
const std::vector<std::string>& keys) { … }
std::string StrikeDatabaseIntegratorBase::GetIdFromKey(
const std::string& key) const { … }
base::TimeDelta StrikeDatabaseIntegratorBase::GetEntryAge(
const StrikeData& strike_data) { … }
std::string StrikeDatabaseIntegratorBase::GetKey(const std::string& id) const { … }
std::optional<size_t> StrikeDatabaseIntegratorBase::GetMaximumEntries() const { … }
std::optional<size_t>
StrikeDatabaseIntegratorBase::GetMaximumEntriesAfterCleanup() const { … }
std::optional<base::TimeDelta>
StrikeDatabaseIntegratorBase::GetRequiredDelaySinceLastStrike() const { … }
}