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

Side by Side Diff: device/usb/usb_device_handle_impl.h

Issue 1874313002: Convert device to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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
« no previous file with comments | « device/usb/usb_device_filter.cc ('k') | device/usb/usb_device_handle_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_USB_USB_DEVICE_HANDLE_IMPL_H_ 5 #ifndef DEVICE_USB_USB_DEVICE_HANDLE_IMPL_H_
6 #define DEVICE_USB_USB_DEVICE_HANDLE_IMPL_H_ 6 #define DEVICE_USB_USB_DEVICE_HANDLE_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <map> 11 #include <map>
12 #include <memory>
12 #include <set> 13 #include <set>
13 #include <vector> 14 #include <vector>
14 15
15 #include "base/callback.h" 16 #include "base/callback.h"
16 #include "base/macros.h" 17 #include "base/macros.h"
17 #include "base/memory/ref_counted.h" 18 #include "base/memory/ref_counted.h"
18 #include "base/threading/thread_checker.h" 19 #include "base/threading/thread_checker.h"
19 #include "device/usb/usb_device_handle.h" 20 #include "device/usb/usb_device_handle.h"
20 #include "third_party/libusb/src/libusb/libusb.h" 21 #include "third_party/libusb/src/libusb/libusb.h"
21 22
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 uint8_t endpoint_address, 173 uint8_t endpoint_address,
173 scoped_refptr<net::IOBuffer> buffer, 174 scoped_refptr<net::IOBuffer> buffer,
174 size_t length, 175 size_t length,
175 unsigned int timeout, 176 unsigned int timeout,
176 scoped_refptr<base::TaskRunner> callback_task_runner, 177 scoped_refptr<base::TaskRunner> callback_task_runner,
177 const TransferCallback& callback); 178 const TransferCallback& callback);
178 179
179 // Submits a transfer and starts tracking it. Retains the buffer and copies 180 // Submits a transfer and starts tracking it. Retains the buffer and copies
180 // the completion callback until the transfer finishes, whereupon it invokes 181 // the completion callback until the transfer finishes, whereupon it invokes
181 // the callback then releases the buffer. 182 // the callback then releases the buffer.
182 void SubmitTransfer(scoped_ptr<Transfer> transfer); 183 void SubmitTransfer(std::unique_ptr<Transfer> transfer);
183 184
184 // Removes the transfer from the in-flight transfer set and invokes the 185 // Removes the transfer from the in-flight transfer set and invokes the
185 // completion callback. 186 // completion callback.
186 void TransferComplete(Transfer* transfer, const base::Closure& callback); 187 void TransferComplete(Transfer* transfer, const base::Closure& callback);
187 188
188 scoped_refptr<UsbDeviceImpl> device_; 189 scoped_refptr<UsbDeviceImpl> device_;
189 190
190 PlatformUsbDeviceHandle handle_; 191 PlatformUsbDeviceHandle handle_;
191 192
192 typedef std::map<int, scoped_refptr<InterfaceClaimer>> ClaimedInterfaceMap; 193 typedef std::map<int, scoped_refptr<InterfaceClaimer>> ClaimedInterfaceMap;
(...skipping 14 matching lines...) Expand all
207 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; 208 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
208 209
209 base::ThreadChecker thread_checker_; 210 base::ThreadChecker thread_checker_;
210 211
211 DISALLOW_COPY_AND_ASSIGN(UsbDeviceHandleImpl); 212 DISALLOW_COPY_AND_ASSIGN(UsbDeviceHandleImpl);
212 }; 213 };
213 214
214 } // namespace device 215 } // namespace device
215 216
216 #endif // DEVICE_USB_USB_DEVICE_HANDLE_IMPL_H_ 217 #endif // DEVICE_USB_USB_DEVICE_HANDLE_IMPL_H_
OLDNEW
« no previous file with comments | « device/usb/usb_device_filter.cc ('k') | device/usb/usb_device_handle_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698