summaryrefslogtreecommitdiffstats
path: root/device/hid/hid_report_descriptor.cc
diff options
context:
space:
mode:
authorreillyg <reillyg@chromium.org>2015-01-12 19:07:11 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-13 03:08:07 +0000
commit37cde99564e8a0789b5904680fa60aa046c6efcc (patch)
tree2a764f83cacfd6328117f0c502a1ec44ec2d851c /device/hid/hid_report_descriptor.cc
parent8dec34f8f3504352e4eef95b2aaa36c561aea930 (diff)
downloadchromium_src-37cde99564e8a0789b5904680fa60aa046c6efcc.zip
chromium_src-37cde99564e8a0789b5904680fa60aa046c6efcc.tar.gz
chromium_src-37cde99564e8a0789b5904680fa60aa046c6efcc.tar.bz2
Include raw HID report descriptor in HID device info.
This change includes the raw HID report descriptor in the HidDeviceInfo class and exposes it to apps and extensions using the chrome.hid API. For simplicity on OS X the platform APIs for collecting information from the report descriptor are no longer used and instead the parsing code from Linux is used. On Windows the raw HID report descriptor is not available because Windows exposes HID devices on a per-top-level collection basis. BUG=442818 Review URL: https://codereview.chromium.org/801833003 Cr-Commit-Position: refs/heads/master@{#311192}
Diffstat (limited to 'device/hid/hid_report_descriptor.cc')
-rw-r--r--device/hid/hid_report_descriptor.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/device/hid/hid_report_descriptor.cc b/device/hid/hid_report_descriptor.cc
index 331186c..f211eb4 100644
--- a/device/hid/hid_report_descriptor.cc
+++ b/device/hid/hid_report_descriptor.cc
@@ -14,10 +14,10 @@ const int kBitsPerByte = 8;
} // namespace
-HidReportDescriptor::HidReportDescriptor(const uint8_t* bytes, size_t size) {
+HidReportDescriptor::HidReportDescriptor(const std::vector<uint8>& bytes) {
size_t header_index = 0;
HidReportDescriptorItem* item = NULL;
- while (header_index < size) {
+ while (header_index < bytes.size()) {
item = new HidReportDescriptorItem(&bytes[header_index], item);
items_.push_back(linked_ptr<HidReportDescriptorItem>(item));
header_index += item->GetSize();