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

Unified Diff: device/bluetooth/bluetooth_adapter.cc

Issue 288903003: [Bluetooth] Standardize Bluetooth device address format to XX:XX:XX:XX:XX:XX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git add unittest Created 6 years, 7 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/bluetooth/bluetooth_adapter.cc
diff --git a/device/bluetooth/bluetooth_adapter.cc b/device/bluetooth/bluetooth_adapter.cc
index d9a24f05ad8c696a5d3ba29aa5564ad0155e77b6..a3964c8a4a2b771c606139c2d15b96acd780a4b2 100644
--- a/device/bluetooth/bluetooth_adapter.cc
+++ b/device/bluetooth/bluetooth_adapter.cc
@@ -73,7 +73,12 @@ BluetoothDevice* BluetoothAdapter::GetDevice(const std::string& address) {
const BluetoothDevice* BluetoothAdapter::GetDevice(
const std::string& address) const {
- DevicesMap::const_iterator iter = devices_.find(address);
+ std::string normalized_address =
keybuk 2014/05/15 21:33:05 nit: canonicalized ;-)
Ilya Sherman 2014/05/15 21:42:29 Done.
+ BluetoothDevice::CanonicalizeAddress(address);
+ if (normalized_address.empty())
+ return NULL;
+
+ DevicesMap::const_iterator iter = devices_.find(normalized_address);
if (iter != devices_.end())
return iter->second;
« no previous file with comments | « chrome/browser/extensions/api/bluetooth/bluetooth_api.cc ('k') | device/bluetooth/bluetooth_adapter_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698