chromium/components/tpcd/metadata/browser/parser.h

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

#ifndef COMPONENTS_TPCD_METADATA_BROWSER_PARSER_H_
#define COMPONENTS_TPCD_METADATA_BROWSER_PARSER_H_

#include <cstdint>
#include <optional>
#include <string>
#include <vector>

#include "base/metrics/field_trial_params.h"
#include "base/observer_list.h"
#include "base/sequence_checker.h"
#include "base/thread_annotations.h"
#include "components/content_settings/core/common/content_settings_enums.mojom.h"
#include "components/tpcd/metadata/common/proto/metadata.pb.h"

namespace tpcd::metadata {
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
//
// NOTE: Keep in sync with `TpcdMetadataInstallationResult` at
// src/tools/metrics/histograms/metadata/navigation/enums.xml
enum class InstallationResult {};

// Enumerates the source of the `MetadataEntry` list return by `GetMetadata()`.
enum class MetadataSource {};

RecordInstallationResultCallback;

MetadataEntries;
TpcdMetadataRuleSource;

class Parser {};

namespace helpers {
MetadataEntry* AddEntryToMetadata(
    Metadata& metadata,
    const std::string& primary_pattern_spec,
    const std::string& secondary_pattern_spec,
    const std::string& source = Parser::kSourceTest,
    const std::optional<uint32_t>& dtrp = std::nullopt,
    const std::optional<uint32_t>& dtrp_override = std::nullopt);
}  // namespace helpers
}  // namespace tpcd::metadata
#endif  // COMPONENTS_TPCD_METADATA_BROWSER_PARSER_H_