| // chromeos/services/machine_learning/public/mojom/graph_executor.mojom-blink.h is auto generated by mojom_bindings_generator.py, do not edit |
| |
| // Copyright 2013 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef CHROMEOS_SERVICES_MACHINE_LEARNING_PUBLIC_MOJOM_GRAPH_EXECUTOR_MOJOM_BLINK_H_ |
| #define CHROMEOS_SERVICES_MACHINE_LEARNING_PUBLIC_MOJOM_GRAPH_EXECUTOR_MOJOM_BLINK_H_ |
| |
| #include <stdint.h> |
| |
| #include <limits> |
| #include <type_traits> |
| #include <utility> |
| |
| #include "third_party/abseil-cpp/absl/types/optional.h" |
| #include "mojo/public/cpp/bindings/clone_traits.h" |
| #include "mojo/public/cpp/bindings/equals_traits.h" |
| #include "mojo/public/cpp/bindings/lib/serialization.h" |
| #include "mojo/public/cpp/bindings/struct_ptr.h" |
| #include "mojo/public/cpp/bindings/struct_traits.h" |
| #include "mojo/public/cpp/bindings/union_traits.h" |
| |
| #include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h" |
| |
| #include "chromeos/services/machine_learning/public/mojom/graph_executor.mojom-shared.h" |
| #include "chromeos/services/machine_learning/public/mojom/graph_executor.mojom-blink-forward.h" |
| #include "chromeos/services/machine_learning/public/mojom/tensor.mojom-blink.h" |
| |
| #include "mojo/public/cpp/bindings/lib/wtf_clone_equals_util.h" |
| #include "mojo/public/cpp/bindings/lib/wtf_hash_util.h" |
| #include "third_party/blink/renderer/platform/wtf/hash_functions.h" |
| #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" |
| |
| #include "mojo/public/cpp/bindings/lib/control_message_handler.h" |
| #include "mojo/public/cpp/bindings/raw_ptr_impl_ref_traits.h" |
| |
| |
| #include "base/component_export.h" |
| |
| #ifdef KYTHE_IS_RUNNING |
| #pragma kythe_inline_metadata "Metadata comment" |
| #endif |
| |
| |
| namespace WTF { |
| struct chromeos_machine_learning_mojom_internal_ExecuteResult_DataHashFn { |
| static unsigned GetHash(const ::chromeos::machine_learning::mojom::ExecuteResult& value) { |
| using utype = std::underlying_type<::chromeos::machine_learning::mojom::ExecuteResult>::type; |
| return DefaultHash<utype>::Hash().GetHash(static_cast<utype>(value)); |
| } |
| static bool Equal(const ::chromeos::machine_learning::mojom::ExecuteResult& left, const ::chromeos::machine_learning::mojom::ExecuteResult& right) { |
| return left == right; |
| } |
| static const bool safe_to_compare_to_empty_or_deleted = true; |
| }; |
| |
| template <> |
| struct HashTraits<::chromeos::machine_learning::mojom::ExecuteResult> |
| : public GenericHashTraits<::chromeos::machine_learning::mojom::ExecuteResult> { |
| static_assert(true, |
| "-1000000 is a reserved enum value"); |
| static_assert(true, |
| "-1000001 is a reserved enum value"); |
| static const bool kEmptyValueIsZero = false; |
| static ::chromeos::machine_learning::mojom::ExecuteResult EmptyValue() { return static_cast<::chromeos::machine_learning::mojom::ExecuteResult>(-1000000); } |
| static void ConstructDeletedValue(::chromeos::machine_learning::mojom::ExecuteResult& slot, bool) { |
| slot = static_cast<::chromeos::machine_learning::mojom::ExecuteResult>(-1000001); |
| } |
| static bool IsDeletedValue(const ::chromeos::machine_learning::mojom::ExecuteResult& value) { |
| return value == static_cast<::chromeos::machine_learning::mojom::ExecuteResult>(-1000001); |
| } |
| }; |
| } // namespace WTF |
| |
| |
| namespace chromeos { |
| namespace machine_learning { |
| namespace mojom { |
| namespace blink { |
| |
| class GraphExecutorProxy; |
| |
| template <typename ImplRefTraits> |
| class GraphExecutorStub; |
| |
| class GraphExecutorRequestValidator; |
| class GraphExecutorResponseValidator; |
| |
| |
| // @generated_from: chromeos.machine_learning.mojom.GraphExecutor |
| class COMPONENT_EXPORT(MLSERVICE_MOJOM_BLINK) GraphExecutor |
| : public GraphExecutorInterfaceBase { |
| public: |
| static const char Name_[]; |
| static std::pair<uint32_t, const void*> MessageToMethodInfo_(mojo::Message& message); |
| static const char* MessageToMethodName_(mojo::Message& message); |
| static constexpr uint32_t Version_ = 0; |
| static constexpr bool PassesAssociatedKinds_ = false; |
| static constexpr bool HasSyncMethods_ = false; |
| static constexpr bool HasUninterruptableMethods_ = false; |
| |
| using Base_ = GraphExecutorInterfaceBase; |
| using Proxy_ = GraphExecutorProxy; |
| |
| template <typename ImplRefTraits> |
| using Stub_ = GraphExecutorStub<ImplRefTraits>; |
| |
| using RequestValidator_ = GraphExecutorRequestValidator; |
| using ResponseValidator_ = GraphExecutorResponseValidator; |
| enum MethodMinVersions : uint32_t { |
| kExecuteMinVersion = 0, |
| }; |
| |
| // crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK |
| // with not having this data in traces there. |
| #if !BUILDFLAG(IS_FUCHSIA) |
| struct Execute_Sym { |
| NOINLINE static void IPCSymbol(); |
| }; |
| #endif // !BUILDFLAG(IS_FUCHSIA) |
| virtual ~GraphExecutor() = default; |
| |
| |
| using ExecuteCallback = base::OnceCallback<void(ExecuteResult, absl::optional<WTF::Vector<::chromeos::machine_learning::mojom::blink::TensorPtr>>)>; |
| |
| // @generated_from: chromeos.machine_learning.mojom.GraphExecutor.Execute |
| virtual void Execute(WTF::HashMap<WTF::String, ::chromeos::machine_learning::mojom::blink::TensorPtr> inputs, const WTF::Vector<WTF::String>& output_names, ExecuteCallback callback) = 0; |
| }; |
| |
| |
| |
| // @generated_from: chromeos.machine_learning.mojom.GraphExecutor |
| class COMPONENT_EXPORT(MLSERVICE_MOJOM_BLINK) GraphExecutorProxy |
| : public GraphExecutor { |
| public: |
| using InterfaceType = GraphExecutor; |
| |
| explicit GraphExecutorProxy(mojo::MessageReceiverWithResponder* receiver); |
| |
| // @generated_from: chromeos.machine_learning.mojom.GraphExecutor.Execute |
| void Execute(WTF::HashMap<WTF::String, ::chromeos::machine_learning::mojom::blink::TensorPtr> inputs, const WTF::Vector<WTF::String>& output_names, ExecuteCallback callback) final; |
| |
| private: |
| mojo::MessageReceiverWithResponder* receiver_; |
| }; |
| class COMPONENT_EXPORT(MLSERVICE_MOJOM_BLINK) GraphExecutorStubDispatch { |
| public: |
| static bool Accept(GraphExecutor* impl, mojo::Message* message); |
| static bool AcceptWithResponder( |
| GraphExecutor* impl, |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder); |
| }; |
| |
| template <typename ImplRefTraits = |
| mojo::RawPtrImplRefTraits<GraphExecutor>> |
| class GraphExecutorStub |
| : public mojo::MessageReceiverWithResponderStatus { |
| public: |
| using ImplPointerType = typename ImplRefTraits::PointerType; |
| |
| GraphExecutorStub() = default; |
| ~GraphExecutorStub() override = default; |
| |
| void set_sink(ImplPointerType sink) { sink_ = std::move(sink); } |
| ImplPointerType& sink() { return sink_; } |
| |
| bool Accept(mojo::Message* message) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return GraphExecutorStubDispatch::Accept( |
| ImplRefTraits::GetRawPointer(&sink_), message); |
| } |
| |
| bool AcceptWithResponder( |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return GraphExecutorStubDispatch::AcceptWithResponder( |
| ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder)); |
| } |
| |
| private: |
| ImplPointerType sink_; |
| }; |
| class COMPONENT_EXPORT(MLSERVICE_MOJOM_BLINK) GraphExecutorRequestValidator : public mojo::MessageReceiver { |
| public: |
| bool Accept(mojo::Message* message) override; |
| }; |
| class COMPONENT_EXPORT(MLSERVICE_MOJOM_BLINK) GraphExecutorResponseValidator : public mojo::MessageReceiver { |
| public: |
| bool Accept(mojo::Message* message) override; |
| }; |
| |
| |
| |
| |
| |
| } // namespace blink |
| } // namespace mojom |
| } // namespace machine_learning |
| } // namespace chromeos |
| |
| namespace mojo { |
| |
| } // namespace mojo |
| |
| #endif // CHROMEOS_SERVICES_MACHINE_LEARNING_PUBLIC_MOJOM_GRAPH_EXECUTOR_MOJOM_BLINK_H_ |
| |
| /* Metadata comment |
| eyJtZXRhIjogW3siZW5kIjogMzcwNywgImJ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