OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "device/hid/hid_connection_linux.h" | 5 #include "device/hid/hid_connection_linux.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <linux/hidraw.h> | 8 #include <linux/hidraw.h> |
9 #include <sys/ioctl.h> | 9 #include <sys/ioctl.h> |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
16 #include "base/message_loop/message_pump_libevent.h" | 16 #include "base/message_loop/message_pump_libevent.h" |
17 #include "base/posix/eintr_wrapper.h" | 17 #include "base/posix/eintr_wrapper.h" |
18 #include "base/thread_task_runner_handle.h" | 18 #include "base/thread_task_runner_handle.h" |
19 #include "base/threading/thread_restrictions.h" | 19 #include "base/threading/thread_restrictions.h" |
20 #include "base/tuple.h" | |
21 #include "device/hid/hid_service.h" | 20 #include "device/hid/hid_service.h" |
22 | 21 |
23 // These are already defined in newer versions of linux/hidraw.h. | 22 // These are already defined in newer versions of linux/hidraw.h. |
24 #ifndef HIDIOCSFEATURE | 23 #ifndef HIDIOCSFEATURE |
25 #define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE | _IOC_READ, 'H', 0x06, len) | 24 #define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE | _IOC_READ, 'H', 0x06, len) |
26 #endif | 25 #endif |
27 #ifndef HIDIOCGFEATURE | 26 #ifndef HIDIOCGFEATURE |
28 #define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE | _IOC_READ, 'H', 0x07, len) | 27 #define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE | _IOC_READ, 'H', 0x07, len) |
29 #endif | 28 #endif |
30 | 29 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 PendingHidReport report = pending_reports_.front(); | 291 PendingHidReport report = pending_reports_.front(); |
293 | 292 |
294 pending_reports_.pop(); | 293 pending_reports_.pop(); |
295 if (CompleteRead(report.buffer, report.size, read.callback)) { | 294 if (CompleteRead(report.buffer, report.size, read.callback)) { |
296 pending_reads_.pop(); | 295 pending_reads_.pop(); |
297 } | 296 } |
298 } | 297 } |
299 } | 298 } |
300 | 299 |
301 } // namespace device | 300 } // namespace device |
OLD | NEW |