#include "components/subresource_filter/core/browser/ruleset_version.h"
#include <string>
#include <string_view>
#include "base/feature_list.h"
#include "base/strings/strcat.h"
#include "base/trace_event/traced_value.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/subresource_filter/core/common/common_features.h"
#include "components/subresource_filter/core/common/indexed_ruleset.h"
namespace subresource_filter {
namespace {
const char kRulesetContentVersionSuffix[] = …;
const char kRulesetFormatVersionSuffix[] = …;
const char kRulesetChecksumSuffix[] = …;
std::string ContentVersionPrefName(std::string_view filter_tag) { … }
std::string FormatVersionPrefName(std::string_view filter_tag) { … }
std::string ChecksumPrefName(std::string_view filter_tag) { … }
}
UnindexedRulesetInfo::UnindexedRulesetInfo() = default;
UnindexedRulesetInfo::~UnindexedRulesetInfo() = default;
UnindexedRulesetInfo::UnindexedRulesetInfo(const UnindexedRulesetInfo&) =
default;
UnindexedRulesetInfo& UnindexedRulesetInfo::operator=(
const UnindexedRulesetInfo&) = default;
IndexedRulesetVersion::IndexedRulesetVersion(std::string_view filter_tag)
: … { … }
IndexedRulesetVersion::IndexedRulesetVersion(std::string_view content_version,
int format_version,
std::string_view filter_tag)
: … { … }
IndexedRulesetVersion::~IndexedRulesetVersion() = default;
IndexedRulesetVersion& IndexedRulesetVersion::operator=(
const IndexedRulesetVersion&) = default;
void IndexedRulesetVersion::RegisterPrefs(PrefRegistrySimple* registry,
std::string_view filter_tag) { … }
int IndexedRulesetVersion::CurrentFormatVersion() { … }
void IndexedRulesetVersion::ReadFromPrefs(PrefService* local_state) { … }
bool IndexedRulesetVersion::IsValid() const { … }
bool IndexedRulesetVersion::IsCurrentFormatVersion() const { … }
void IndexedRulesetVersion::SaveToPrefs(PrefService* local_state) const { … }
std::unique_ptr<base::trace_event::TracedValue>
IndexedRulesetVersion::ToTracedValue() const { … }
}