#include "components/tpcd/metadata/browser/parser.h"
#include <string>
#include <utility>
#include "base/base64.h"
#include "base/check.h"
#include "base/functional/callback_helpers.h"
#include "base/metrics/field_trial_params.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/sequence_checker.h"
#include "base/strings/strcat.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/content_settings/core/common/features.h"
#include "components/tpcd/metadata/common/proto/metadata.pb.h"
#include "net/base/features.h"
#include "third_party/zlib/google/compression_utils.h"
namespace tpcd::metadata {
Parser* Parser::GetInstance() { … }
TpcdMetadataRuleSource Parser::ToRuleSource(const std::string& source) { … }
bool Parser::IsValidMetadata(const Metadata& metadata,
RecordInstallationResultCallback callback) { … }
Parser::Parser() = default;
Parser::~Parser() = default;
MetadataEntries ToMetadataEntries(const Metadata& metadata) { … }
void Parser::ParseMetadata(const std::string& raw_metadata) { … }
MetadataEntries ParseMetadataFromFeatureParam(
const base::FieldTrialParams& params) { … }
void Parser::AddObserver(Observer* observer) { … }
void Parser::RemoveObserver(Observer* observer) { … }
void Parser::CallOnMetadataReady() { … }
MetadataEntries Parser::GetMetadata() { … }
MetadataEntries Parser::GetInstalledMetadataForTesting() { … }
void Parser::ResetStatesForTesting() { … }
MetadataEntries Parser::ParseMetadataFromFeatureParamForTesting(
const base::FieldTrialParams& params) { … }
namespace helpers {
MetadataEntry* AddEntryToMetadata(
Metadata& metadata,
const std::string& primary_pattern_spec,
const std::string& secondary_pattern_spec,
const std::string& source,
const std::optional<uint32_t>& dtrp,
const std::optional<uint32_t>& dtrp_override) { … }
}
}