#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "services/webnn/public/mojom/webnn_context.mojom.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/features.h"
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "mojo/public/cpp/bindings/urgent_message_scope.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
#include "services/webnn/public/mojom/webnn_context.mojom-params-data.h"
#include "services/webnn/public/mojom/webnn_context.mojom-shared-message-ids.h"
#include "services/webnn/public/mojom/webnn_context.mojom-import-headers.h"
#include "services/webnn/public/mojom/webnn_context.mojom-test-utils.h"
namespace webnn::mojom {
CreateBufferSuccess::CreateBufferSuccess()
: … { … }
CreateBufferSuccess::CreateBufferSuccess(
::mojo::PendingAssociatedRemote<::webnn::mojom::WebNNBuffer> buffer_remote_in,
const ::blink::WebNNBufferToken& buffer_handle_in)
: … { … }
CreateBufferSuccess::~CreateBufferSuccess() = default;
void CreateBufferSuccess::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool CreateBufferSuccess::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
CreateBufferResult::CreateBufferResult() : … { … }
CreateBufferResult::~CreateBufferResult() { … }
void CreateBufferResult::set_success(
CreateBufferSuccessPtr success) { … }
void CreateBufferResult::set_error(
::webnn::mojom::ErrorPtr error) { … }
void CreateBufferResult::DestroyActive() { … }
bool CreateBufferResult::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char WebNNContext::Name_[] = …;
WebNNContext::IPCStableHashFunction WebNNContext::MessageToMethodInfo_(mojo::Message& message) { … }
const char* WebNNContext::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t WebNNContext::CreateGraphBuilder_Sym::IPCStableHash() { … }
uint32_t WebNNContext::CreateBuffer_Sym::IPCStableHash() { … }
# endif
bool WebNNContext::RuntimeFeature_IsEnabled_(bool expected) { … }
class WebNNContext_CreateBuffer_ForwardToCallback
: public mojo::MessageReceiver { … };
WebNNContextProxy::WebNNContextProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void WebNNContextProxy::CreateGraphBuilder(
::mojo::PendingAssociatedReceiver<::webnn::mojom::WebNNGraphBuilder> in_receiver) { … }
void WebNNContextProxy::CreateBuffer(
::webnn::mojom::BufferInfoPtr in_buffer_info, CreateBufferCallback callback) { … }
class WebNNContext_CreateBuffer_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool WebNNContext_CreateBuffer_ForwardToCallback::Accept(
mojo::Message* message) { … }
void WebNNContext_CreateBuffer_ProxyToResponder::Run(
CreateBufferResultPtr in_result) { … }
bool WebNNContextStubDispatch::Accept(
WebNNContext* impl,
mojo::Message* message) { … }
bool WebNNContextStubDispatch::AcceptWithResponder(
WebNNContext* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kWebNNContextValidationInfo[] = …;
bool WebNNContextRequestValidator::Accept(mojo::Message* message) { … }
bool WebNNContextResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::webnn::mojom::CreateBufferSuccess::DataView, ::webnn::mojom::CreateBufferSuccessPtr>::Read(
::webnn::mojom::CreateBufferSuccess::DataView input,
::webnn::mojom::CreateBufferSuccessPtr* output) { … }
bool UnionTraits<::webnn::mojom::CreateBufferResult::DataView, ::webnn::mojom::CreateBufferResultPtr>::Read(
::webnn::mojom::CreateBufferResult::DataView input,
::webnn::mojom::CreateBufferResultPtr* output) { … }
}
namespace webnn::mojom {
void WebNNContextInterceptorForTesting::CreateGraphBuilder(::mojo::PendingAssociatedReceiver<::webnn::mojom::WebNNGraphBuilder> receiver) { … }
void WebNNContextInterceptorForTesting::CreateBuffer(::webnn::mojom::BufferInfoPtr buffer_info, CreateBufferCallback callback) { … }
WebNNContextAsyncWaiter::WebNNContextAsyncWaiter(
WebNNContext* proxy) : … { … }
WebNNContextAsyncWaiter::~WebNNContextAsyncWaiter() = default;
void WebNNContextAsyncWaiter::CreateBuffer(
::webnn::mojom::BufferInfoPtr buffer_info, CreateBufferResultPtr* out_result) { … }
CreateBufferResultPtr WebNNContextAsyncWaiter::CreateBuffer(
::webnn::mojom::BufferInfoPtr buffer_info) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif