| // Copyright 2023 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #ifndef SERVICES_WEBNN_WEBNN_CONTEXT_IMPL_H_ |
| #define SERVICES_WEBNN_WEBNN_CONTEXT_IMPL_H_ |
| #include "mojo/public/cpp/bindings/pending_receiver.h" |
| #include "mojo/public/cpp/bindings/receiver.h" |
| #include "services/webnn/public/mojom/webnn_service.mojom.h" |
| class WebNNContextProviderImpl; |
| class WebNNContextImpl : public mojom::WebNNContext { |
| WebNNContextImpl(mojo::PendingReceiver<mojom::WebNNContext> receiver, |
| WebNNContextProviderImpl* context_provider); |
| WebNNContextImpl(const WebNNContextImpl&) = delete; |
| WebNNContextImpl& operator=(const WebNNContextImpl&) = delete; |
| ~WebNNContextImpl() override; |
| void OnConnectionError(); |
| void CreateGraph(mojom::GraphInfoPtr graph_info, |
| CreateGraphCallback callback) override; |
| mojo::Receiver<mojom::WebNNContext> receiver_; |
| raw_ptr<WebNNContextProviderImpl> context_provider_; |
| #endif // SERVICES_WEBNN_WEBNN_CONTEXT_IMPL_H_ |