#include "components/optimization_guide/core/optimization_filter.h"
#include <string>
#include <string_view>
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "crypto/sha2.h"
#include "url/gurl.h"
namespace optimization_guide {
namespace {
const int kMaxSuffixCount = …;
const int kMinHostSuffix = …;
bool MatchesRegexp(const GURL& url, const RegexpList& regexps) { … }
std::string SHA256(std::string_view input) { … }
}
OptimizationFilter::OptimizationFilter(
std::unique_ptr<BloomFilter> bloom_filter,
std::unique_ptr<RegexpList> regexps,
std::unique_ptr<RegexpList> exclusion_regexps,
bool skip_host_suffix_checking,
proto::BloomFilterFormat bloom_filter_format)
: … { … }
OptimizationFilter::~OptimizationFilter() = default;
bool OptimizationFilter::Matches(const GURL& url) const { … }
bool OptimizationFilter::ContainsHostSuffix(const GURL& url) const { … }
}