#include "components/heavy_ad_intervention/heavy_ad_blocklist.h"
#include <string>
#include <utility>
#include "base/metrics/field_trial_params.h"
#include "components/blocklist/opt_out_blocklist/opt_out_store.h"
#include "components/heavy_ad_intervention/heavy_ad_features.h"
namespace heavy_ad_intervention {
namespace {
const char kHostDurationHours[] = …;
const char kHostThreshold[] = …;
const char kHostsInMemory[] = …;
const char kTypeVersion[] = …;
int GetBlocklistParamValue(const std::string& param, int default_value) { … }
}
HeavyAdBlocklist::HeavyAdBlocklist(
std::unique_ptr<blocklist::OptOutStore> opt_out_store,
base::Clock* clock,
blocklist::OptOutBlocklistDelegate* blocklist_delegate)
: … { … }
HeavyAdBlocklist::~HeavyAdBlocklist() = default;
bool HeavyAdBlocklist::ShouldUseSessionPolicy(base::TimeDelta* duration,
size_t* history,
int* threshold) const { … }
bool HeavyAdBlocklist::ShouldUsePersistentPolicy(base::TimeDelta* duration,
size_t* history,
int* threshold) const { … }
bool HeavyAdBlocklist::ShouldUseHostPolicy(base::TimeDelta* duration,
size_t* history,
int* threshold,
size_t* max_hosts) const { … }
bool HeavyAdBlocklist::ShouldUseTypePolicy(base::TimeDelta* duration,
size_t* history,
int* threshold) const { … }
blocklist::BlocklistData::AllowedTypesAndVersions
HeavyAdBlocklist::GetAllowedTypes() const { … }
}