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 <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <utility> | 13 #include <utility> |
14 | 14 |
15 #include "base/bind.h" | 15 #include "base/bind.h" |
16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
17 #include "base/macros.h" | 17 #include "base/macros.h" |
18 #include "base/message_loop/message_loop.h" | 18 #include "base/message_loop/message_loop.h" |
19 #include "base/message_loop/message_pump_libevent.h" | 19 #include "base/message_loop/message_pump_libevent.h" |
20 #include "base/posix/eintr_wrapper.h" | 20 #include "base/posix/eintr_wrapper.h" |
21 #include "base/thread_task_runner_handle.h" | |
22 #include "base/threading/thread_restrictions.h" | 21 #include "base/threading/thread_restrictions.h" |
| 22 #include "base/threading/thread_task_runner_handle.h" |
23 #include "components/device_event_log/device_event_log.h" | 23 #include "components/device_event_log/device_event_log.h" |
24 #include "device/hid/hid_service.h" | 24 #include "device/hid/hid_service.h" |
25 | 25 |
26 // These are already defined in newer versions of linux/hidraw.h. | 26 // These are already defined in newer versions of linux/hidraw.h. |
27 #ifndef HIDIOCSFEATURE | 27 #ifndef HIDIOCSFEATURE |
28 #define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE | _IOC_READ, 'H', 0x06, len) | 28 #define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE | _IOC_READ, 'H', 0x06, len) |
29 #endif | 29 #endif |
30 #ifndef HIDIOCGFEATURE | 30 #ifndef HIDIOCGFEATURE |
31 #define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE | _IOC_READ, 'H', 0x07, len) | 31 #define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE | _IOC_READ, 'H', 0x07, len) |
32 #endif | 32 #endif |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 PendingHidReport report = pending_reports_.front(); | 319 PendingHidReport report = pending_reports_.front(); |
320 | 320 |
321 pending_reports_.pop(); | 321 pending_reports_.pop(); |
322 if (CompleteRead(report.buffer, report.size, read.callback)) { | 322 if (CompleteRead(report.buffer, report.size, read.callback)) { |
323 pending_reads_.pop(); | 323 pending_reads_.pop(); |
324 } | 324 } |
325 } | 325 } |
326 } | 326 } |
327 | 327 |
328 } // namespace device | 328 } // namespace device |
OLD | NEW |