Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: device/usb/mojo/device_impl.h

Issue 2234443002: Mojo C++ binding: make device/usb mojom targets use STD string/vector types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move the vector converter into a private header. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_USB_MOJO_DEVICE_IMPL_H_ 5 #ifndef DEVICE_USB_MOJO_DEVICE_IMPL_H_
6 #define DEVICE_USB_MOJO_DEVICE_IMPL_H_ 6 #define DEVICE_USB_MOJO_DEVICE_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <vector>
9 10
10 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
13 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
14 #include "base/scoped_observer.h" 15 #include "base/scoped_observer.h"
15 #include "device/usb/mojo/permission_provider.h" 16 #include "device/usb/mojo/permission_provider.h"
16 #include "device/usb/public/interfaces/device.mojom.h" 17 #include "device/usb/public/interfaces/device.mojom.h"
17 #include "device/usb/usb_device.h" 18 #include "device/usb/usb_device.h"
18 #include "device/usb/usb_device_handle.h" 19 #include "device/usb/usb_device_handle.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 uint8_t interface_number, 68 uint8_t interface_number,
68 uint8_t alternate_setting, 69 uint8_t alternate_setting,
69 const SetInterfaceAlternateSettingCallback& callback) override; 70 const SetInterfaceAlternateSettingCallback& callback) override;
70 void Reset(const ResetCallback& callback) override; 71 void Reset(const ResetCallback& callback) override;
71 void ClearHalt(uint8_t endpoint, const ClearHaltCallback& callback) override; 72 void ClearHalt(uint8_t endpoint, const ClearHaltCallback& callback) override;
72 void ControlTransferIn(ControlTransferParamsPtr params, 73 void ControlTransferIn(ControlTransferParamsPtr params,
73 uint32_t length, 74 uint32_t length,
74 uint32_t timeout, 75 uint32_t timeout,
75 const ControlTransferInCallback& callback) override; 76 const ControlTransferInCallback& callback) override;
76 void ControlTransferOut(ControlTransferParamsPtr params, 77 void ControlTransferOut(ControlTransferParamsPtr params,
77 mojo::Array<uint8_t> data, 78 const std::vector<uint8_t>& data,
78 uint32_t timeout, 79 uint32_t timeout,
79 const ControlTransferOutCallback& callback) override; 80 const ControlTransferOutCallback& callback) override;
80 void GenericTransferIn(uint8_t endpoint_number, 81 void GenericTransferIn(uint8_t endpoint_number,
81 uint32_t length, 82 uint32_t length,
82 uint32_t timeout, 83 uint32_t timeout,
83 const GenericTransferInCallback& callback) override; 84 const GenericTransferInCallback& callback) override;
84 void GenericTransferOut(uint8_t endpoint_number, 85 void GenericTransferOut(uint8_t endpoint_number,
85 mojo::Array<uint8_t> data, 86 const std::vector<uint8_t>& data,
86 uint32_t timeout, 87 uint32_t timeout,
87 const GenericTransferOutCallback& callback) override; 88 const GenericTransferOutCallback& callback) override;
88 void IsochronousTransferIn( 89 void IsochronousTransferIn(
89 uint8_t endpoint_number, 90 uint8_t endpoint_number,
90 mojo::Array<uint32_t> packet_lengths, 91 const std::vector<uint32_t>& packet_lengths,
91 uint32_t timeout, 92 uint32_t timeout,
92 const IsochronousTransferInCallback& callback) override; 93 const IsochronousTransferInCallback& callback) override;
93 void IsochronousTransferOut( 94 void IsochronousTransferOut(
94 uint8_t endpoint_number, 95 uint8_t endpoint_number,
95 mojo::Array<uint8_t> data, 96 const std::vector<uint8_t>& data,
96 mojo::Array<uint32_t> packet_lengths, 97 const std::vector<uint32_t>& packet_lengths,
97 uint32_t timeout, 98 uint32_t timeout,
98 const IsochronousTransferOutCallback& callback) override; 99 const IsochronousTransferOutCallback& callback) override;
99 100
100 // device::UsbDevice::Observer implementation: 101 // device::UsbDevice::Observer implementation:
101 void OnDeviceRemoved(scoped_refptr<device::UsbDevice> device) override; 102 void OnDeviceRemoved(scoped_refptr<device::UsbDevice> device) override;
102 103
103 const scoped_refptr<UsbDevice> device_; 104 const scoped_refptr<UsbDevice> device_;
104 const DeviceInfoPtr device_info_; 105 const DeviceInfoPtr device_info_;
105 base::WeakPtr<PermissionProvider> permission_provider_; 106 base::WeakPtr<PermissionProvider> permission_provider_;
106 ScopedObserver<device::UsbDevice, device::UsbDevice::Observer> observer_; 107 ScopedObserver<device::UsbDevice, device::UsbDevice::Observer> observer_;
107 108
108 // The device handle. Will be null before the device is opened and after it 109 // The device handle. Will be null before the device is opened and after it
109 // has been closed. 110 // has been closed.
110 scoped_refptr<UsbDeviceHandle> device_handle_; 111 scoped_refptr<UsbDeviceHandle> device_handle_;
111 112
112 mojo::StrongBinding<Device> binding_; 113 mojo::StrongBinding<Device> binding_;
113 base::WeakPtrFactory<DeviceImpl> weak_factory_; 114 base::WeakPtrFactory<DeviceImpl> weak_factory_;
114 115
115 DISALLOW_COPY_AND_ASSIGN(DeviceImpl); 116 DISALLOW_COPY_AND_ASSIGN(DeviceImpl);
116 }; 117 };
117 118
118 } // namespace usb 119 } // namespace usb
119 } // namespace device 120 } // namespace device
120 121
121 #endif // DEVICE_USB_MOJO_DEVICE_IMPL_H_ 122 #endif // DEVICE_USB_MOJO_DEVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698