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

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

Issue 10972018: Changing USB API buffer ownership. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style fix, don't memset. Created 8 years, 3 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_device_resource.cc ('k') | chrome/browser/usb/usb_device.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/usb/usb_device.h
diff --git a/chrome/browser/usb/usb_device.h b/chrome/browser/usb/usb_device.h
index 2ed50873de433c733c462ee8f717c10987df88d6..cc58134d597fd675534af975e5bdaf9e76700f15 100644
--- a/chrome/browser/usb/usb_device.h
+++ b/chrome/browser/usb/usb_device.h
@@ -37,7 +37,8 @@ enum UsbTransferStatus {
USB_TRANSFER_LENGTH_SHORT,
};
-typedef base::Callback<void(UsbTransferStatus)> UsbTransferCallback;
+typedef base::Callback<void(UsbTransferStatus, scoped_refptr<net::IOBuffer>,
+ size_t)> UsbTransferCallback;
// A UsbDevice wraps the platform's underlying representation of what a USB
// device actually is, and provides accessors for performing many of the
@@ -110,7 +111,9 @@ class UsbDevice : public base::RefCounted<UsbDevice> {
Transfer();
~Transfer();
+ bool control_transfer;
scoped_refptr<net::IOBuffer> buffer;
+ size_t length;
UsbTransferCallback callback;
};
@@ -120,7 +123,10 @@ class UsbDevice : public base::RefCounted<UsbDevice> {
// Submits a transfer and starts tracking it. Retains the buffer and copies
// the completion callback until the transfer finishes, whereupon it invokes
// the callback then releases the buffer.
- void SubmitTransfer(PlatformUsbTransferHandle handle, net::IOBuffer* buffer,
+ void SubmitTransfer(PlatformUsbTransferHandle handle,
+ bool control_transfer,
+ net::IOBuffer* buffer,
+ const size_t length,
const UsbTransferCallback& callback);
// The UsbService isn't referenced here to prevent a dependency cycle between
« no previous file with comments | « chrome/browser/extensions/api/usb/usb_device_resource.cc ('k') | chrome/browser/usb/usb_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698