#include "services/device/hid/hid_connection.h"
#include "base/containers/contains.h"
#include "base/memory/ref_counted_memory.h"
#include "base/ranges/algorithm.h"
#include "components/device_event_log/device_event_log.h"
#include "services/device/public/cpp/hid/hid_report_type.h"
#include "services/device/public/cpp/hid/hid_report_utils.h"
#include "services/device/public/mojom/hid.mojom.h"
namespace device {
namespace {
bool HasAlwaysProtectedCollection(
const std::vector<mojom::HidCollectionInfoPtr>& collections) { … }
}
HidConnection::HidConnection(scoped_refptr<HidDeviceInfo> device_info,
bool allow_protected_reports,
bool allow_fido_reports)
: … { … }
HidConnection::~HidConnection() { … }
void HidConnection::SetClient(Client* client) { … }
void HidConnection::Close() { … }
void HidConnection::Read(ReadCallback callback) { … }
void HidConnection::Write(scoped_refptr<base::RefCountedBytes> buffer,
WriteCallback callback) { … }
void HidConnection::GetFeatureReport(uint8_t report_id, ReadCallback callback) { … }
void HidConnection::SendFeatureReport(
scoped_refptr<base::RefCountedBytes> buffer,
WriteCallback callback) { … }
bool HidConnection::IsReportProtected(uint8_t report_id,
HidReportType report_type) const { … }
void HidConnection::ProcessInputReport(
scoped_refptr<base::RefCountedBytes> buffer,
size_t size) { … }
void HidConnection::ProcessReadQueue() { … }
}