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

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

Issue 22914023: Introducing chrome.usb.getDevices/openDevice API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@usb-interface
Patch Set: Created 7 years, 4 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
Index: chrome/browser/usb/usb_service.h
diff --git a/chrome/browser/usb/usb_service.h b/chrome/browser/usb/usb_service.h
index e89eff9cf85eb33e3892a103853edc64d6ed3b17..e0a93f6acd456137d4ef70ab0fd8e5181721379f 100644
--- a/chrome/browser/usb/usb_service.h
+++ b/chrome/browser/usb/usb_service.h
@@ -45,6 +45,9 @@ class UsbService {
int interface_id,
const base::Callback<void(ScopedDeviceVector vector)>& callback);
+
+ scoped_refptr<UsbDevice> GetDeviceById(uint32 unique_id);
+
// Get all of the devices attached to the system, inserting them into
// |devices|. Clears |devices| before use. The result will be sorted by id
// in increasing order. Must be called on FILE thread.
@@ -86,6 +89,8 @@ class UsbService {
scoped_refptr<UsbContext> context_;
+ uint32 next_unique_id_;
+
// The map from PlatformUsbDevices to UsbDevices.
typedef std::map<PlatformUsbDevice, scoped_refptr<UsbDevice> > DeviceMap;
DeviceMap devices_;

Powered by Google App Engine
This is Rietveld 408576698