#include "components/optimization_guide/core/model_execution/safety_model_info.h"
#include <memory>
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/types/optional_ref.h"
#include "components/optimization_guide/core/model_info.h"
#include "components/optimization_guide/core/optimization_guide_constants.h"
#include "components/optimization_guide/core/optimization_guide_enums.h"
#include "components/optimization_guide/core/optimization_guide_util.h"
#include "components/optimization_guide/proto/model_execution.pb.h"
#include "components/optimization_guide/proto/text_safety_model_metadata.pb.h"
namespace optimization_guide {
namespace {
class ScopedTextSafetyModelMetadataValidityLogger { … };
bool HasRequiredSafetyFiles(const ModelInfo& model_info) { … }
}
std::unique_ptr<SafetyModelInfo> SafetyModelInfo::Load(
base::optional_ref<const ModelInfo> opt_model_info) { … }
std::optional<proto::FeatureTextSafetyConfiguration> SafetyModelInfo::GetConfig(
proto::ModelExecutionFeature feature) const { … }
base::FilePath SafetyModelInfo::GetDataPath() const { … }
base::FilePath SafetyModelInfo::GetSpModelPath() const { … }
int64_t SafetyModelInfo::GetVersion() const { … }
SafetyModelInfo::SafetyModelInfo(
const ModelInfo& model_info,
uint32_t num_output_categories,
base::flat_map<proto::ModelExecutionFeature,
proto::FeatureTextSafetyConfiguration> feature_configs)
: … { … }
SafetyModelInfo::~SafetyModelInfo() = default;
}