#ifndef SERVICES_WEBNN_PUBLIC_MOJOM_WEBNN_CONTEXT_PROVIDER_MOJOM_BLINK_H_
#define SERVICES_WEBNN_PUBLIC_MOJOM_WEBNN_CONTEXT_PROVIDER_MOJOM_BLINK_H_
#include <stdint.h>
#include <limits>
#include <optional>
#include <type_traits>
#include <utility>
#include "base/types/cxx23_to_underlying.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 "services/webnn/public/mojom/webnn_context_provider.mojom-features.h"
#include "services/webnn/public/mojom/webnn_context_provider.mojom-shared.h"
#include "services/webnn/public/mojom/webnn_context_provider.mojom-blink-forward.h"
#include "services/webnn/public/mojom/features.mojom-blink-forward.h"
#include "services/webnn/public/mojom/webnn_context.mojom-blink-forward.h"
#include "services/webnn/public/mojom/webnn_context_properties.mojom-blink.h"
#include "services/webnn/public/mojom/webnn_error.mojom-blink.h"
#include "third_party/blink/public/mojom/tokens/tokens.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/lib/message_size_estimator.h"
#include "mojo/public/cpp/bindings/raw_ptr_impl_ref_traits.h"
#include "base/component_export.h"
namespace webnn::mojom::blink {
class WebNNContextProviderProxy;
template <typename ImplRefTraits>
class WebNNContextProviderStub;
class WebNNContextProviderRequestValidator;
class WebNNContextProviderResponseValidator;
class COMPONENT_EXPORT(WEBNN_MOJOM_BLINK) WebNNContextProvider
: public WebNNContextProviderInterfaceBase { … };
class COMPONENT_EXPORT(WEBNN_MOJOM_BLINK) WebNNContextProviderProxy
: public WebNNContextProvider { … };
class COMPONENT_EXPORT(WEBNN_MOJOM_BLINK) WebNNContextProviderStubDispatch { … };
template <typename ImplRefTraits =
mojo::RawPtrImplRefTraits<WebNNContextProvider>>
class WebNNContextProviderStub
: public mojo::MessageReceiverWithResponderStatus {
public:
using ImplPointerType = typename ImplRefTraits::PointerType;
WebNNContextProviderStub() = default;
~WebNNContextProviderStub() override = default;
void set_sink(ImplPointerType sink) { … }
ImplPointerType& sink() { … }
bool Accept(mojo::Message* message) override { … }
bool AcceptWithResponder(
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override { … }
private:
ImplPointerType sink_;
};
class COMPONENT_EXPORT(WEBNN_MOJOM_BLINK) WebNNContextProviderRequestValidator : public mojo::MessageReceiver { … };
class COMPONENT_EXPORT(WEBNN_MOJOM_BLINK) WebNNContextProviderResponseValidator : public mojo::MessageReceiver { … };
class COMPONENT_EXPORT(WEBNN_MOJOM_BLINK) CreateContextOptions { … };
template <typename T, CreateContextOptions::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);
template <typename T, CreateContextOptions::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) { … }
template <typename T, CreateContextOptions::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) { … }
template <typename T, CreateContextOptions::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) { … }
class COMPONENT_EXPORT(WEBNN_MOJOM_BLINK) CreateContextResult { … };
class COMPONENT_EXPORT(WEBNN_MOJOM_BLINK) CreateContextSuccess { … };
template <typename T, CreateContextSuccess::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);
template <typename T, CreateContextSuccess::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) { … }
template <typename T, CreateContextSuccess::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) { … }
template <typename T, CreateContextSuccess::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) { … }
template <typename UnionPtrType>
CreateContextResultPtr CreateContextResult::Clone() const { … }
template <typename T,
typename std::enable_if<std::is_same<
T, CreateContextResult>::value>::type*>
bool CreateContextResult::Equals(const T& other) const { … }
template <typename StructPtrType>
CreateContextOptionsPtr CreateContextOptions::Clone() const { … }
template <typename T, CreateContextOptions::EnableIfSame<T>*>
bool CreateContextOptions::Equals(const T& other_struct) const { … }
template <typename T, CreateContextOptions::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) { … }
template <typename StructPtrType>
CreateContextSuccessPtr CreateContextSuccess::Clone() const { … }
template <typename T, CreateContextSuccess::EnableIfSame<T>*>
bool CreateContextSuccess::Equals(const T& other_struct) const { … }
template <typename T, CreateContextSuccess::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) { … }
}
namespace mojo {
template <>
struct COMPONENT_EXPORT(WEBNN_MOJOM_BLINK) StructTraits<::webnn::mojom::blink::CreateContextOptions::DataView,
::webnn::mojom::blink::CreateContextOptionsPtr> { … };
template <>
struct COMPONENT_EXPORT(WEBNN_MOJOM_BLINK) StructTraits<::webnn::mojom::blink::CreateContextSuccess::DataView,
::webnn::mojom::blink::CreateContextSuccessPtr> { … };
template <>
struct COMPONENT_EXPORT(WEBNN_MOJOM_BLINK) UnionTraits<::webnn::mojom::blink::CreateContextResult::DataView,
::webnn::mojom::blink::CreateContextResultPtr> { … };
namespace internal {
template <>
inline bool GetRuntimeFeature_IsEnabled<::webnn::mojom::blink::WebNNContextProvider>() { … }
template <>
inline bool GetRuntimeFeature_ExpectEnabled<::webnn::mojom::blink::WebNNContextProvider>() {
return ::webnn::mojom::blink::WebNNContextProvider::RuntimeFeature_IsEnabled_(true);
}kIsRuntimeFeatureGuarded;
}
}
#endif