#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "services/device/hid/hid_connection_impl.h"
#include "base/functional/bind.h"
#include "base/memory/ref_counted_memory.h"
#include "base/ranges/algorithm.h"
namespace device {
void HidConnectionImpl::Create(
scoped_refptr<device::HidConnection> connection,
mojo::PendingReceiver<mojom::HidConnection> receiver,
mojo::PendingRemote<mojom::HidConnectionClient> connection_client,
mojo::PendingRemote<mojom::HidConnectionWatcher> watcher) { … }
HidConnectionImpl::HidConnectionImpl(
scoped_refptr<device::HidConnection> connection,
mojo::PendingReceiver<mojom::HidConnection> receiver,
mojo::PendingRemote<mojom::HidConnectionClient> connection_client,
mojo::PendingRemote<mojom::HidConnectionWatcher> watcher)
: … { … }
HidConnectionImpl::~HidConnectionImpl() { … }
void HidConnectionImpl::OnInputReport(
scoped_refptr<base::RefCountedBytes> buffer,
size_t size) { … }
void HidConnectionImpl::Read(ReadCallback callback) { … }
void HidConnectionImpl::OnRead(ReadCallback callback,
bool success,
scoped_refptr<base::RefCountedBytes> buffer,
size_t size) { … }
void HidConnectionImpl::Write(uint8_t report_id,
const std::vector<uint8_t>& buffer,
WriteCallback callback) { … }
void HidConnectionImpl::OnWrite(WriteCallback callback, bool success) { … }
void HidConnectionImpl::GetFeatureReport(uint8_t report_id,
GetFeatureReportCallback callback) { … }
void HidConnectionImpl::OnGetFeatureReport(
GetFeatureReportCallback callback,
bool success,
scoped_refptr<base::RefCountedBytes> buffer,
size_t size) { … }
void HidConnectionImpl::SendFeatureReport(uint8_t report_id,
const std::vector<uint8_t>& buffer,
SendFeatureReportCallback callback) { … }
void HidConnectionImpl::OnSendFeatureReport(SendFeatureReportCallback callback,
bool success) { … }
}