prediction_model_override.h 1.0 KB

123456789101112131415161718192021222324
  1. // Copyright 2022 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_OPTIMIZATION_GUIDE_CORE_PREDICTION_MODEL_OVERRIDE_H_
  5. #define COMPONENTS_OPTIMIZATION_GUIDE_CORE_PREDICTION_MODEL_OVERRIDE_H_
  6. #include "base/callback.h"
  7. #include "components/optimization_guide/proto/models.pb.h"
  8. namespace optimization_guide {
  9. // Attempts to parse the result from |GetModelOverrideForOptimizationTarget|
  10. // into a |proto::PredictionModel|, returning the result in the given callback
  11. // or nullptr if there was an error. In the event of an error, check LOG(ERROR).
  12. using OnPredictionModelBuiltCallback =
  13. base::OnceCallback<void(std::unique_ptr<proto::PredictionModel>)>;
  14. void BuildPredictionModelFromCommandLineForOptimizationTarget(
  15. proto::OptimizationTarget optimization_target,
  16. OnPredictionModelBuiltCallback callback);
  17. } // namespace optimization_guide
  18. #endif // COMPONENTS_OPTIMIZATION_GUIDE_CORE_PREDICTION_MODEL_OVERRIDE_H_