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

Unified Diff: device/usb/usb_service_impl.h

Issue 1903933002: Store devices that only need to be enumerated once (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed device leak at usb_service_impl.cc Created 4 years, 8 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 | « no previous file | device/usb/usb_service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_service_impl.h
diff --git a/device/usb/usb_service_impl.h b/device/usb/usb_service_impl.h
index 7b05904cbac81f618da378f1a76e98d450df366d..203aab411afa217baeeabd7288464255abf29588 100644
--- a/device/usb/usb_service_impl.h
+++ b/device/usb/usb_service_impl.h
@@ -80,6 +80,11 @@ class UsbServiceImpl :
void OnPlatformDeviceAdded(PlatformUsbDevice platform_device);
void OnPlatformDeviceRemoved(PlatformUsbDevice platform_device);
+ // Add |platform_device| to the |ignored_devices_| and
+ // run |refresh_complete|.
+ void EnumerationFailed(PlatformUsbDevice platform_device,
+ const base::Closure& refresh_complete);
+
scoped_refptr<UsbContext> context_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
@@ -105,6 +110,10 @@ class UsbServiceImpl :
PlatformDeviceMap;
PlatformDeviceMap platform_devices_;
+ // The set of devices that only need to be enumerated once and then can be
+ // ignored (for example, hub devices, devices that failed enumeration, etc.).
+ std::set<PlatformUsbDevice> ignored_devices_;
+
// Tracks PlatformUsbDevices that might be removed while they are being
// enumerated.
std::set<PlatformUsbDevice> devices_being_enumerated_;
« no previous file with comments | « no previous file | device/usb/usb_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698