#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/browsing_topics/common/semantic_tree.h"
#include <map>
#include <set>
#include <variant>
#include "base/check.h"
#include "base/check_op.h"
#include "base/containers/flat_set.h"
#include "base/containers/span.h"
#include "base/memory/raw_span.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "components/strings/grit/components_strings.h"
#include "third_party/blink/public/common/features.h"
namespace browsing_topics {
namespace …
SemanticTree::SemanticTree() = default;
SemanticTree::~SemanticTree() = default;
Topic SemanticTree::GetRandomTopic(int taxonomy_version,
uint64_t random_topic_index_decision) { … }
std::vector<Topic> SemanticTree::GetFirstLevelTopicsInCurrentTaxonomy() { … }
std::vector<Topic>
SemanticTree::GetFirstLevelTopicsInCurrentTaxonomyInternal() { … }
std::set<int> SemanticTree::GetTopicsInCurrentTaxonomyInternal() { … }
std::vector<Topic> SemanticTree::GetAtMostTwoRepresentativesInCurrentTaxonomy(
const Topic& topic) { … }
bool SemanticTree::IsTaxonomySupported(int taxonomy_version) { … }
std::vector<Topic> SemanticTree::GetDescendantTopics(const Topic& topic,
bool only_direct) { … }
std::vector<Topic> SemanticTree::GetAncestorTopics(const Topic& topic) { … }
std::optional<int> SemanticTree::GetLatestLocalizedNameMessageId(
const Topic& topic) { … }
std::optional<int> SemanticTree::GetLocalizedNameMessageId(
const Topic& topic,
int taxonomy_version) { … }
}