chromium/components/subresource_filter/core/common/indexed_ruleset.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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;

// A helper function to get the checksum on a data buffer.
int LocalGetChecksum(base::span<const uint8_t> data) {}

VerifyStatus GetVerifyStatus(base::span<const uint8_t> buffer,
                             int expected_checksum) {}

}  // namespace

// RulesetIndexer --------------------------------------------------------------

const int RulesetIndexer::kIndexedFormatVersion =;

// This static assert is meant to catch cases where
// url_pattern_index::kUrlPatternIndexFormatVersion is incremented without
// updating RulesetIndexer::kIndexedFormatVersion.
static_assert;

RulesetIndexer::RulesetIndexer()
    :{}

RulesetIndexer::~RulesetIndexer() = default;

bool RulesetIndexer::AddUrlRule(const proto::UrlRule& rule) {}

void RulesetIndexer::Finish() {}

int RulesetIndexer::GetChecksum() const {}

// IndexedRulesetMatcher -------------------------------------------------------

// static
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 {}

}  // namespace subresource_filter