| 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 #ifndef DEVICE_HID_HID_CONNECTION_MAC_H_ | 5 #ifndef DEVICE_HID_HID_CONNECTION_MAC_H_ |
| 6 #define DEVICE_HID_HID_CONNECTION_MAC_H_ | 6 #define DEVICE_HID_HID_CONNECTION_MAC_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/tuple.h" | 10 #include "base/tuple.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 CFIndex reportLength); | 53 CFIndex reportLength); |
| 54 | 54 |
| 55 void WriteReport(IOHIDReportType type, | 55 void WriteReport(IOHIDReportType type, |
| 56 scoped_refptr<net::IOBuffer> buffer, | 56 scoped_refptr<net::IOBuffer> buffer, |
| 57 size_t size, | 57 size_t size, |
| 58 const IOCallback& callback); | 58 const IOCallback& callback); |
| 59 | 59 |
| 60 HidServiceMac* service_; | 60 HidServiceMac* service_; |
| 61 scoped_refptr<base::MessageLoopProxy> message_loop_; | 61 scoped_refptr<base::MessageLoopProxy> message_loop_; |
| 62 base::ScopedCFTypeRef<IOHIDDeviceRef> device_; | 62 base::ScopedCFTypeRef<IOHIDDeviceRef> device_; |
| 63 scoped_ptr_malloc<uint8_t> inbound_buffer_; | 63 scoped_ptr<uint8_t, base::FreeDeleter> inbound_buffer_; |
| 64 bool disconnected_; | 64 bool disconnected_; |
| 65 | 65 |
| 66 typedef std::pair<scoped_refptr<net::IOBuffer>, size_t> PendingReport; | 66 typedef std::pair<scoped_refptr<net::IOBuffer>, size_t> PendingReport; |
| 67 std::queue<PendingReport> input_reports_; | 67 std::queue<PendingReport> input_reports_; |
| 68 typedef Tuple3<scoped_refptr<net::IOBuffer>, size_t, IOCallback> PendingRead; | 68 typedef Tuple3<scoped_refptr<net::IOBuffer>, size_t, IOCallback> PendingRead; |
| 69 std::queue<PendingRead> read_queue_; | 69 std::queue<PendingRead> read_queue_; |
| 70 | 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(HidConnectionMac); | 71 DISALLOW_COPY_AND_ASSIGN(HidConnectionMac); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 | 74 |
| 75 } // namespace device | 75 } // namespace device |
| 76 | 76 |
| 77 #endif // DEVICE_HID_HID_CONNECTION_MAC_H_ | 77 #endif // DEVICE_HID_HID_CONNECTION_MAC_H_ |
| OLD | NEW |