ml: mojo bindings switch to new types
After libchrome r860220 uprev, the old mojo bindings would be
deprecated.
Changed MachineLearningServiceImpl constructor to take
mojo::PendingReceiver<MachineLearningService> directly instead of
mojo::ScopedMessagePipeHandle.
BUG=chromium:1179608
TEST=FEATURES=test emerge-amd64-generic ml with fuzzer profile
TEST=cros_run_unit_tests --board=eve ml
Change-Id: Iae7496d08395e6d84108dfe2b6f447f86b256830
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2744966
Tested-by: Grace Cham <hscham@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Andrew Moylan <amoylan@chromium.org>
Commit-Queue: Grace Cham <hscham@chromium.org>
diff --git a/ml/machine_learning_service_impl.h b/ml/machine_learning_service_impl.h
index 522d3da..0f5927d 100644
--- a/ml/machine_learning_service_impl.h
+++ b/ml/machine_learning_service_impl.h
@@ -28,16 +28,20 @@
// Creates an instance bound to `pipe`. The specified `disconnect_handler`
// will be invoked if the binding encounters a connection error or is closed.
// The `bus` is used to construct `dlcservice_client_` if it is not nullptr.
- MachineLearningServiceImpl(mojo::ScopedMessagePipeHandle pipe,
- base::Closure disconnect_handler,
- dbus::Bus* bus = nullptr);
+ MachineLearningServiceImpl(
+ mojo::PendingReceiver<
+ chromeos::machine_learning::mojom::MachineLearningService> receiver,
+ base::Closure disconnect_handler,
+ dbus::Bus* bus = nullptr);
protected:
// Testing constructor that allows overriding of the model dir. Should not be
// used outside of tests.
- MachineLearningServiceImpl(mojo::ScopedMessagePipeHandle pipe,
- base::Closure disconnect_handler,
- const std::string& model_dir);
+ MachineLearningServiceImpl(
+ mojo::PendingReceiver<
+ chromeos::machine_learning::mojom::MachineLearningService> receiver,
+ base::Closure disconnect_handler,
+ const std::string& model_dir);
MachineLearningServiceImpl(const MachineLearningServiceImpl&) = delete;
MachineLearningServiceImpl& operator=(const MachineLearningServiceImpl&) =
delete;