#include "services/webnn/tflite/buffer_impl_tflite.h"
#include <climits>
#include "base/compiler_specific.h"
#include "base/memory/ptr_util.h"
#include "base/memory/scoped_refptr.h"
#include "services/webnn/public/mojom/webnn_buffer.mojom.h"
#include "services/webnn/queueable_resource_state.h"
#include "services/webnn/queueable_resource_state_base.h"
#include "services/webnn/resource_task.h"
#include "services/webnn/tflite/buffer_content.h"
#include "services/webnn/webnn_utils.h"
#include "third_party/tflite/src/tensorflow/lite/util.h"
namespace webnn::tflite {
base::expected<std::unique_ptr<WebNNBufferImpl>, mojom::ErrorPtr>
BufferImplTflite::Create(
mojo::PendingAssociatedReceiver<mojom::WebNNBuffer> receiver,
WebNNContextImpl* context,
mojom::BufferInfoPtr buffer_info) { … }
BufferImplTflite::BufferImplTflite(
mojo::PendingAssociatedReceiver<mojom::WebNNBuffer> receiver,
WebNNContextImpl* context,
mojom::BufferInfoPtr buffer_info,
scoped_refptr<QueueableResourceState<BufferContent>> buffer_state,
base::PassKey<BufferImplTflite>)
: … { … }
BufferImplTflite::~BufferImplTflite() { … }
const scoped_refptr<QueueableResourceState<BufferContent>>&
BufferImplTflite::GetBufferState() const { … }
void BufferImplTflite::ReadBufferImpl(ReadBufferCallback callback) { … }
void BufferImplTflite::WriteBufferImpl(mojo_base::BigBuffer src_buffer) { … }
}