| Index: device/hid/hid_connection_mac.cc
|
| diff --git a/device/hid/hid_connection_mac.cc b/device/hid/hid_connection_mac.cc
|
| index ce17df4cc9b395db475acc97e3bb097d4220eb4c..4999f2e9b91c3c26d3661a12eee89705d660c2e1 100644
|
| --- a/device/hid/hid_connection_mac.cc
|
| +++ b/device/hid/hid_connection_mac.cc
|
| @@ -20,10 +20,10 @@ HidConnectionMac::HidConnectionMac(HidDeviceInfo device_info)
|
| message_loop_ = base::MessageLoopProxy::current();
|
|
|
| DCHECK(device_.get());
|
| - inbound_buffer_.reset((uint8_t*)malloc(device_info.input_report_size));
|
| + inbound_buffer_.reset((uint8_t*)malloc(device_info.max_input_report_size));
|
| IOHIDDeviceRegisterInputReportCallback(device_.get(),
|
| inbound_buffer_.get(),
|
| - device_info.input_report_size,
|
| + device_info.max_input_report_size,
|
| &HidConnectionMac::InputReportCallback,
|
| this);
|
| IOHIDDeviceOpen(device_, kIOHIDOptionsTypeNone);
|
| @@ -66,25 +66,25 @@ void HidConnectionMac::GetFeatureReport(
|
| scoped_refptr<net::IOBufferWithSize> buffer,
|
| const IOCallback& callback) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| - if (device_info().feature_report_size == 0) {
|
| + if (device_info().max_feature_report_size == 0) {
|
| callback.Run(false, 0);
|
| return;
|
| }
|
|
|
| - if (buffer->size() < device_info().feature_report_size) {
|
| + if (buffer->size() < device_info().max_feature_report_size) {
|
| callback.Run(false, 0);
|
| return;
|
| }
|
|
|
| uint8_t* feature_report_buffer = reinterpret_cast<uint8_t*>(buffer->data());
|
| - CFIndex feature_report_size = device_info().feature_report_size;
|
| + CFIndex max_feature_report_size = device_info().max_feature_report_size;
|
| IOReturn result = IOHIDDeviceGetReport(device_,
|
| kIOHIDReportTypeFeature,
|
| report_id,
|
| feature_report_buffer,
|
| - &feature_report_size);
|
| + &max_feature_report_size);
|
| if (result == kIOReturnSuccess)
|
| - callback.Run(true, feature_report_size);
|
| + callback.Run(true, max_feature_report_size);
|
| else
|
| callback.Run(false, 0);
|
| }
|
|
|