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

Unified Diff: device/devices_app/usb/device_manager_impl.h

Issue 1342663003: Pass full Mojo USB DeviceInfo object with removal notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: device/devices_app/usb/device_manager_impl.h
diff --git a/device/devices_app/usb/device_manager_impl.h b/device/devices_app/usb/device_manager_impl.h
index b84f2544e0cbd0c6188db3ac866209fe08565903..1d325bace765028fec6c7d300ab352a01135978f 100644
--- a/device/devices_app/usb/device_manager_impl.h
+++ b/device/devices_app/usb/device_manager_impl.h
@@ -50,6 +50,9 @@ class DeviceManagerImpl : public DeviceManager {
private:
class ServiceThreadHelper;
+ typedef std::vector<scoped_refptr<UsbDevice>> DeviceList;
Ken Rockot(use gerrit already) 2015/09/15 18:09:25 nit: using instead of typedef
Reilly Grant (use Gerrit) 2015/09/15 19:46:48 Done.
+ typedef std::map<std::string, scoped_refptr<device::UsbDevice>> DeviceMap;
+
// DeviceManager implementation:
void GetDevices(EnumerationOptionsPtr options,
const GetDevicesCallback& callback) override;
@@ -64,16 +67,17 @@ class DeviceManagerImpl : public DeviceManager {
mojo::Array<mojo::String> allowed_guids);
// Callbacks to handle the async responses from the underlying UsbService.
- void OnGetDevices(const GetDevicesCallback& callback,
- mojo::Array<DeviceInfoPtr> devices);
+ void OnGetDevices(EnumerationOptionsPtr options,
+ const GetDevicesCallback& callback,
+ const DeviceList& devices);
// Methods called by |helper_| when devices are added or removed.
- void OnDeviceAdded(DeviceInfoPtr device);
- void OnDeviceRemoved(std::string device_guid);
+ void OnDeviceAdded(scoped_refptr<device::UsbDevice> device);
+ void OnDeviceRemoved(scoped_refptr<device::UsbDevice> device);
void MaybeRunDeviceChangesCallback();
void OnEnumerationPermissionCheckComplete(
- mojo::Array<DeviceInfoPtr> devices_added,
- const std::set<std::string>& devices_removed,
+ const DeviceMap& devices_added,
+ const DeviceMap& devices_removed,
mojo::Array<mojo::String> allowed_guids);
PermissionProviderPtr permission_provider_;
@@ -84,8 +88,8 @@ class DeviceManagerImpl : public DeviceManager {
// are collected in |devices_added_| and |devices_removed_| until the
// next call to GetDeviceChanges.
std::queue<GetDeviceChangesCallback> device_change_callbacks_;
- mojo::Array<DeviceInfoPtr> devices_added_;
- std::set<std::string> devices_removed_;
+ DeviceMap devices_added_;
+ DeviceMap devices_removed_;
// To ensure that GetDeviceChangesCallbacks are called in the correct order
// only perform a single request to |permission_provider_| at a time.
bool permission_request_pending_ = false;
« no previous file with comments | « no previous file | device/devices_app/usb/device_manager_impl.cc » ('j') | device/devices_app/usb/device_manager_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698