#include "components/subresource_filter/core/common/indexed_ruleset.h"
#include "base/check.h"
#include "base/hash/hash.h"
#include "base/metrics/histogram_functions.h"
#include "base/not_fatal_until.h"
#include "base/strings/strcat.h"
#include "base/trace_event/trace_event.h"
#include "components/subresource_filter/core/common/first_party_origin.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace subresource_filter {
namespace {
proto;
FindRuleStrategy;
EmbedderConditionsMatcher;
int LocalGetChecksum(base::span<const uint8_t> data) { … }
VerifyStatus GetVerifyStatus(base::span<const uint8_t> buffer,
int expected_checksum) { … }
}
const int RulesetIndexer::kIndexedFormatVersion = …;
static_assert …;
RulesetIndexer::RulesetIndexer()
: … { … }
RulesetIndexer::~RulesetIndexer() = default;
bool RulesetIndexer::AddUrlRule(const proto::UrlRule& rule) { … }
void RulesetIndexer::Finish() { … }
int RulesetIndexer::GetChecksum() const { … }
bool IndexedRulesetMatcher::Verify(base::span<const uint8_t> buffer,
int expected_checksum,
std::string_view uma_tag) { … }
IndexedRulesetMatcher::IndexedRulesetMatcher(base::span<const uint8_t> buffer)
: … { … }
bool IndexedRulesetMatcher::ShouldDisableFilteringForDocument(
const GURL& document_url,
const url::Origin& parent_document_origin,
proto::ActivationType activation_type) const { … }
LoadPolicy IndexedRulesetMatcher::GetLoadPolicyForResourceLoad(
const GURL& url,
const FirstPartyOrigin& first_party,
proto::ElementType element_type,
bool disable_generic_rules) const { … }
const url_pattern_index::flat::UrlRule* IndexedRulesetMatcher::MatchedUrlRule(
const GURL& url,
const FirstPartyOrigin& first_party,
url_pattern_index::proto::ElementType element_type,
bool disable_generic_rules) const { … }
}