chromium/chrome/browser/navigation_predictor/preloading_model_keyed_service.cc

// 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.

#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 {

// The model takes all of its inputs as floats, so this is a convenience
// function for turning various types into floats.
template <typename T>
constexpr float ToInput(T val) {}

template <>
constexpr float ToInput(base::TimeDelta val) {}

static_assert;

}  // namespace

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) {}