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

Unified Diff: extensions/browser/api/hid/hid_api.cc

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 | « device/hid/hid_service_win.cc ('k') | extensions/browser/api/hid/hid_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/hid/hid_api.cc
diff --git a/extensions/browser/api/hid/hid_api.cc b/extensions/browser/api/hid/hid_api.cc
index 73e91506b7910922bf496f0045de3a95f73d8a36..e021cf2a8cc1aaa88a13edd9b0a8592c69ba3f26 100644
--- a/extensions/browser/api/hid/hid_api.cc
+++ b/extensions/browser/api/hid/hid_api.cc
@@ -121,8 +121,9 @@ ExtensionFunction::ResponseAction HidConnectFunction::Run() {
return RespondNow(Error(kErrorServiceUnavailable));
}
- HidDeviceInfo device_info;
- if (!device_manager->GetDeviceInfo(parameters->device_id, &device_info)) {
+ scoped_refptr<HidDeviceInfo> device_info =
+ device_manager->GetDeviceInfo(parameters->device_id);
+ if (!device_info) {
return RespondNow(Error(kErrorInvalidDeviceId));
}
@@ -136,7 +137,7 @@ ExtensionFunction::ResponseAction HidConnectFunction::Run() {
}
hid_service->Connect(
- device_info.device_id,
+ device_info->device_id(),
base::Bind(&HidConnectFunction::OnConnectComplete, this));
return RespondLater();
}
« no previous file with comments | « device/hid/hid_service_win.cc ('k') | extensions/browser/api/hid/hid_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698