OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef DEVICE_HID_HID_SERVICE_MAC_H_ | 5 #ifndef DEVICE_HID_HID_SERVICE_MAC_H_ |
6 #define DEVICE_HID_HID_SERVICE_MAC_H_ | 6 #define DEVICE_HID_HID_SERVICE_MAC_H_ |
7 | 7 |
8 #include <CoreFoundation/CoreFoundation.h> | 8 #include <CoreFoundation/CoreFoundation.h> |
9 #include <IOKit/IOKitLib.h> | 9 #include <IOKit/IOKitLib.h> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 private: | 33 private: |
34 ~HidServiceMac() override; | 34 ~HidServiceMac() override; |
35 | 35 |
36 // IOService matching callbacks. | 36 // IOService matching callbacks. |
37 static void FirstMatchCallback(void* context, io_iterator_t iterator); | 37 static void FirstMatchCallback(void* context, io_iterator_t iterator); |
38 static void TerminatedCallback(void* context, io_iterator_t iterator); | 38 static void TerminatedCallback(void* context, io_iterator_t iterator); |
39 | 39 |
40 void AddDevices(); | 40 void AddDevices(); |
41 void RemoveDevices(); | 41 void RemoveDevices(); |
42 | 42 |
| 43 static scoped_refptr<device::HidDeviceInfo> CreateDeviceInfo( |
| 44 io_service_t device); |
| 45 |
43 // Platform notification port. | 46 // Platform notification port. |
44 IONotificationPortRef notify_port_; | 47 IONotificationPortRef notify_port_; |
45 base::mac::ScopedIOObject<io_iterator_t> devices_added_iterator_; | 48 base::mac::ScopedIOObject<io_iterator_t> devices_added_iterator_; |
46 base::mac::ScopedIOObject<io_iterator_t> devices_removed_iterator_; | 49 base::mac::ScopedIOObject<io_iterator_t> devices_removed_iterator_; |
47 | 50 |
48 // The task runner for the thread on which this service was created. | 51 // The task runner for the thread on which this service was created. |
49 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 52 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
50 | 53 |
51 // The task runner for the FILE thread of the application using this service | 54 // The task runner for the FILE thread of the application using this service |
52 // on which slow running I/O operations can be performed. | 55 // on which slow running I/O operations can be performed. |
53 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; | 56 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; |
54 | 57 |
55 DISALLOW_COPY_AND_ASSIGN(HidServiceMac); | 58 DISALLOW_COPY_AND_ASSIGN(HidServiceMac); |
56 }; | 59 }; |
57 | 60 |
58 } // namespace device | 61 } // namespace device |
59 | 62 |
60 #endif // DEVICE_HID_HID_SERVICE_MAC_H_ | 63 #endif // DEVICE_HID_HID_SERVICE_MAC_H_ |
OLD | NEW |