| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
| 12 #include "base/memory/ref_counted.h" |
| 12 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
| 13 #include "chrome/browser/extensions/api/api_resource.h" | 14 #include "chrome/browser/extensions/api/api_resource.h" |
| 14 #include "chrome/browser/usb/usb_device.h" | 15 #include "chrome/browser/usb/usb_device.h" |
| 15 #include "chrome/common/extensions/api/experimental_usb.h" | 16 #include "chrome/common/extensions/api/experimental_usb.h" |
| 16 | 17 |
| 17 class UsbDevice; | 18 class UsbDevice; |
| 18 | 19 |
| 19 namespace net { | 20 namespace net { |
| 20 class IOBuffer; | 21 class IOBuffer; |
| 21 } // namespace net | 22 } // namespace net |
| (...skipping 21 matching lines...) Expand all Loading... |
| 43 const api::experimental_usb::ControlTransferInfo& transfer); | 44 const api::experimental_usb::ControlTransferInfo& transfer); |
| 44 void InterruptTransfer( | 45 void InterruptTransfer( |
| 45 const api::experimental_usb::GenericTransferInfo& transfer); | 46 const api::experimental_usb::GenericTransferInfo& transfer); |
| 46 void BulkTransfer(const api::experimental_usb::GenericTransferInfo& transfer); | 47 void BulkTransfer(const api::experimental_usb::GenericTransferInfo& transfer); |
| 47 void IsochronousTransfer( | 48 void IsochronousTransfer( |
| 48 const api::experimental_usb::IsochronousTransferInfo& transfer); | 49 const api::experimental_usb::IsochronousTransferInfo& transfer); |
| 49 | 50 |
| 50 private: | 51 private: |
| 51 // Invoked by the underlying device's transfer callbacks. Indicates transfer | 52 // Invoked by the underlying device's transfer callbacks. Indicates transfer |
| 52 // completion to the ApiResource's event notifier. | 53 // completion to the ApiResource's event notifier. |
| 53 void TransferComplete(net::IOBuffer* buffer, const size_t length, | 54 void TransferComplete(UsbTransferStatus status, |
| 54 UsbTransferStatus status); | 55 scoped_refptr<net::IOBuffer> buffer, |
| 56 size_t length); |
| 55 | 57 |
| 56 scoped_refptr<UsbDevice> device_; | 58 scoped_refptr<UsbDevice> device_; |
| 57 | 59 |
| 58 DISALLOW_COPY_AND_ASSIGN(UsbDeviceResource); | 60 DISALLOW_COPY_AND_ASSIGN(UsbDeviceResource); |
| 59 }; | 61 }; |
| 60 | 62 |
| 61 } // namespace extensions | 63 } // namespace extensions |
| 62 | 64 |
| 63 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ | 65 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ |
| OLD | NEW |