#include "chrome/browser/navigation_predictor/preloading_model_keyed_service.h"
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service.h"
#include "components/optimization_guide/machine_learning_tflite_buildflags.h"
#if BUILDFLAG(BUILD_WITH_TFLITE_LIB)
#include "chrome/browser/navigation_predictor/preloading_model_handler.h"
#endif
namespace {
template <typename T>
constexpr float ToInput(T val) { … }
template <>
constexpr float ToInput(base::TimeDelta val) { … }
static_assert …;
}
PreloadingModelKeyedService::Inputs::Inputs() = default;
PreloadingModelKeyedService::Inputs::Inputs(const Inputs& other) = default;
PreloadingModelKeyedService::Inputs&
PreloadingModelKeyedService::Inputs::operator=(const Inputs& other) = default;
PreloadingModelKeyedService::PreloadingModelKeyedService(
OptimizationGuideKeyedService* optimization_guide_keyed_service) { … }
PreloadingModelKeyedService::~PreloadingModelKeyedService() = default;
void PreloadingModelKeyedService::AddOnModelUpdatedCallbackForTesting(
base::OnceClosure callback) { … }
void PreloadingModelKeyedService::Score(base::CancelableTaskTracker* tracker,
const Inputs& inputs,
ResultCallback result_callback) { … }