OLD | NEW |
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 #include "device/usb/mojo/device_impl.h" | 5 #include "device/usb/mojo/device_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
11 #include <numeric> | 11 #include <numeric> |
12 #include <utility> | 12 #include <utility> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/bind.h" | 15 #include "base/bind.h" |
16 #include "base/callback.h" | 16 #include "base/callback.h" |
17 #include "base/memory/ptr_util.h" | 17 #include "base/memory/ptr_util.h" |
18 #include "base/stl_util.h" | 18 #include "base/stl_util.h" |
19 #include "device/usb/mojo/type_converters.h" | 19 #include "device/usb/mojo/type_converters.h" |
20 #include "device/usb/usb_descriptors.h" | 20 #include "device/usb/usb_descriptors.h" |
21 #include "device/usb/usb_device.h" | 21 #include "device/usb/usb_device.h" |
22 #include "mojo/common/common_type_converters.h" | |
23 #include "net/base/io_buffer.h" | 22 #include "net/base/io_buffer.h" |
24 | 23 |
25 namespace device { | 24 namespace device { |
26 namespace usb { | 25 namespace usb { |
27 | 26 |
28 namespace { | 27 namespace { |
29 | 28 |
30 scoped_refptr<net::IOBuffer> CreateTransferBuffer(size_t size) { | 29 scoped_refptr<net::IOBuffer> CreateTransferBuffer(size_t size) { |
31 return new net::IOBuffer( | 30 return new net::IOBuffer( |
32 std::max(static_cast<size_t>(1u), static_cast<size_t>(size))); | 31 std::max(static_cast<size_t>(1u), static_cast<size_t>(size))); |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 base::Bind(&OnIsochronousTransferOut, callback)); | 432 base::Bind(&OnIsochronousTransferOut, callback)); |
434 } | 433 } |
435 | 434 |
436 void DeviceImpl::OnDeviceRemoved(scoped_refptr<UsbDevice> device) { | 435 void DeviceImpl::OnDeviceRemoved(scoped_refptr<UsbDevice> device) { |
437 DCHECK_EQ(device_, device); | 436 DCHECK_EQ(device_, device); |
438 delete this; | 437 delete this; |
439 } | 438 } |
440 | 439 |
441 } // namespace usb | 440 } // namespace usb |
442 } // namespace device | 441 } // namespace device |
OLD | NEW |