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

Unified Diff: extensions/browser/api/hid/hid_device_manager.h

Issue 825523003: Convert HidDeviceInfo from a struct to a refcounted class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added TODO to remove friend class definitions. Created 5 years, 11 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 | « extensions/browser/api/hid/hid_apitest.cc ('k') | extensions/browser/api/hid/hid_device_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/hid/hid_device_manager.h
diff --git a/extensions/browser/api/hid/hid_device_manager.h b/extensions/browser/api/hid/hid_device_manager.h
index e979693344567ddda4f32ccd65791652a0fb98e5..d39eccdac455a05285db52758d6c90e0d8dfac07 100644
--- a/extensions/browser/api/hid/hid_device_manager.h
+++ b/extensions/browser/api/hid/hid_device_manager.h
@@ -55,10 +55,10 @@ class HidDeviceManager : public BrowserContextKeyedAPI,
const std::vector<device::HidDeviceFilter>& filters,
const GetApiDevicesCallback& callback);
- bool GetDeviceInfo(int resource_id, device::HidDeviceInfo* device_info);
+ scoped_refptr<device::HidDeviceInfo> GetDeviceInfo(int resource_id);
static bool HasPermission(const Extension* extension,
- const device::HidDeviceInfo& device_info);
+ scoped_refptr<device::HidDeviceInfo> device_info);
private:
friend class BrowserContextKeyedAPIFactory<HidDeviceManager>;
@@ -80,8 +80,9 @@ class HidDeviceManager : public BrowserContextKeyedAPI,
void OnListenerAdded(const EventListenerInfo& details) override;
// HidService::Observer:
- void OnDeviceAdded(const device::HidDeviceInfo& device_info) override;
- void OnDeviceRemoved(const device::HidDeviceInfo& device_info) override;
+ void OnDeviceAdded(scoped_refptr<device::HidDeviceInfo> device_info) override;
+ void OnDeviceRemoved(
+ scoped_refptr<device::HidDeviceInfo> device_info) override;
// Wait to perform an initial enumeration and register a HidService::Observer
// until the first API customer makes a request or registers an event
@@ -94,11 +95,12 @@ class HidDeviceManager : public BrowserContextKeyedAPI,
scoped_ptr<base::ListValue> CreateApiDeviceList(
const Extension* extension,
const std::vector<device::HidDeviceFilter>& filters);
- void OnEnumerationComplete(const std::vector<device::HidDeviceInfo>& devices);
+ void OnEnumerationComplete(
+ const std::vector<scoped_refptr<device::HidDeviceInfo>>& devices);
void DispatchEvent(const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
- const device::HidDeviceInfo& device_info);
+ scoped_refptr<device::HidDeviceInfo> device_info);
base::ThreadChecker thread_checker_;
EventRouter* event_router_;
« no previous file with comments | « extensions/browser/api/hid/hid_apitest.cc ('k') | extensions/browser/api/hid/hid_device_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698