blob: 1c64a2d36f8396364ebe3636044b86fa91eb32bf [file] [log] [blame]
Andrew Moylanff6be512018-07-03 11:05:01 +10001// Copyright 2018 The Chromium OS 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
5#ifndef ML_MACHINE_LEARNING_SERVICE_IMPL_H_
6#define ML_MACHINE_LEARNING_SERVICE_IMPL_H_
7
8#include <base/callback_forward.h>
9#include <base/macros.h>
10#include <mojo/public/cpp/bindings/binding.h>
11
12#include "mojom/machine_learning_service.mojom.h"
13
14namespace ml {
15
16class MachineLearningServiceImpl
17 : public chromeos::machine_learning::mojom::MachineLearningService {
18 public:
19 // Creates an instance bound to |pipe|. The specified
20 // |connection_error_handler| will be invoked if the binding encounters a
21 // connection error.
22 MachineLearningServiceImpl(mojo::ScopedMessagePipeHandle pipe,
23 base::Closure connection_error_handler);
24
25 private:
26 // chromeos::machine_learning::mojom::MachineLearningService:
Andrew Moylane465a592018-08-01 16:13:50 +100027 void LoadModel(
28 chromeos::machine_learning::mojom::ModelSpecPtr spec,
29 chromeos::machine_learning::mojom::ModelRequest request) override;
Andrew Moylanff6be512018-07-03 11:05:01 +100030
31 mojo::Binding<chromeos::machine_learning::mojom::MachineLearningService>
32 binding_;
33
34 DISALLOW_COPY_AND_ASSIGN(MachineLearningServiceImpl);
35};
36
37} // namespace ml
38
39#endif // ML_MACHINE_LEARNING_SERVICE_IMPL_H_