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

Unified Diff: chrome/browser/usb/usb_device_handle.h

Issue 19981004: Remove callbacks on USB manipulation methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browser_tests Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/api/usb/usb_apitest.cc ('k') | chrome/browser/usb/usb_device_handle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/usb/usb_device_handle.h
diff --git a/chrome/browser/usb/usb_device_handle.h b/chrome/browser/usb/usb_device_handle.h
index 54ed216050a9f27055ea08afb01df3ce8e65f215..e46ab19c167b5efe87f09a598bfcd78b9fba3e38 100644
--- a/chrome/browser/usb/usb_device_handle.h
+++ b/chrome/browser/usb/usb_device_handle.h
@@ -43,7 +43,6 @@ enum UsbTransferStatus {
typedef base::Callback<void(UsbTransferStatus, scoped_refptr<net::IOBuffer>,
size_t)> UsbTransferCallback;
-typedef base::Callback<void(bool success)> UsbInterfaceCallback;
// A UsbDevice wraps the platform's underlying representation of what a USB
// device actually is, and provides accessors for performing many of the
@@ -60,24 +59,19 @@ class UsbDeviceHandle : public base::RefCounted<UsbDeviceHandle> {
PlatformUsbDeviceHandle handle() { return handle_; }
- // Close the USB device and release the underlying platform device. |callback|
- // is invoked after the device has been closed.
- virtual void Close(const base::Callback<void()>& callback);
+ // Close the USB device and release the underlying platform device.
+ virtual void Close();
- virtual void ListInterfaces(UsbConfigDescriptor* config,
- const UsbInterfaceCallback& callback);
-
- virtual void ClaimInterface(const int interface_number,
- const UsbInterfaceCallback& callback);
-
- virtual void ReleaseInterface(const int interface_number,
- const UsbInterfaceCallback& callback);
-
- virtual void SetInterfaceAlternateSetting(
+ // Device manipulation operations. These methods are blocking.
+ virtual bool ListInterfaces(UsbConfigDescriptor* config);
+ virtual bool ClaimInterface(const int interface_number);
+ virtual bool ReleaseInterface(const int interface_number);
+ virtual bool SetInterfaceAlternateSetting(
const int interface_number,
- const int alternate_setting,
- const UsbInterfaceCallback& callback);
+ const int alternate_setting);
+ virtual bool ResetDevice();
+ // Async IO.
virtual void ControlTransfer(const UsbEndpointDirection direction,
const TransferRequestType request_type,
const TransferRecipient recipient,
@@ -112,8 +106,6 @@ class UsbDeviceHandle : public base::RefCounted<UsbDeviceHandle> {
const unsigned int timeout,
const UsbTransferCallback& callback);
- virtual void ResetDevice(const base::Callback<void(bool success)>& callback);
-
// Normal code should not call this function. It is called by the platform's
// callback mechanism in such a way that it cannot be made private. Invokes
// the callbacks associated with a given transfer, and removes it from the
« no previous file with comments | « chrome/browser/extensions/api/usb/usb_apitest.cc ('k') | chrome/browser/usb/usb_device_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698