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

Unified Diff: device/hid/hid_service.cc

Issue 161823002: Clean up HID backend and API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for reals Created 6 years, 10 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/hid/hid_service.cc
diff --git a/device/hid/hid_service.cc b/device/hid/hid_service.cc
index 973e901a82b8a77b12388c906954ee5ea2eeac27..75ee69cd2c3c21dd6a546f0025f05756c6114b08 100644
--- a/device/hid/hid_service.cc
+++ b/device/hid/hid_service.cc
@@ -59,7 +59,8 @@ void HidService::GetDevices(std::vector<HidDeviceInfo>* devices) {
}
// Fills in the device info struct of the given device_id.
-bool HidService::GetInfo(std::string device_id, HidDeviceInfo* info) const {
+bool HidService::GetInfo(const std::string& device_id,
+ HidDeviceInfo* info) const {
DeviceMap::const_iterator it = devices_.find(device_id);
if (it == devices_.end())
return false;
@@ -74,7 +75,7 @@ void HidService::AddDevice(HidDeviceInfo info) {
}
}
-void HidService::RemoveDevice(std::string device_id) {
+void HidService::RemoveDevice(const std::string& device_id) {
if (ContainsKey(devices_, device_id)) {
DCHECK(thread_checker_.CalledOnValidThread());
devices_.erase(device_id);

Powered by Google App Engine
This is Rietveld 408576698