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

Unified Diff: chrome/browser/chromeos/bluetooth/bluetooth_device.cc

Issue 10829391: Fix Bluetooth Connect API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/bluetooth/bluetooth_device.cc
diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_device.cc b/chrome/browser/chromeos/bluetooth/bluetooth_device.cc
index 39fce947c3fc961120a14aed0e963c3e994fdeed..47c1ae93e47af4d6ef890854108601872f26e148 100644
--- a/chrome/browser/chromeos/bluetooth/bluetooth_device.cc
+++ b/chrome/browser/chromeos/bluetooth/bluetooth_device.cc
@@ -642,14 +642,16 @@ void BluetoothDevice::GetServiceRecordsForConnectCallback(
const std::string& service_uuid,
const SocketCallback& callback,
const ServiceRecordList& list) {
- // If multiple service records are found, use the first one that works.
for (ServiceRecordList::const_iterator i = list.begin();
i != list.end(); ++i) {
- scoped_refptr<BluetoothSocket> socket(
- BluetoothSocket::CreateBluetoothSocket(**i));
- if (socket.get() != NULL) {
- callback.Run(socket);
- return;
+ if ((*i)->uuid() == service_uuid) {
+ // If multiple service records are found, use the first one that works.
+ scoped_refptr<BluetoothSocket> socket(
+ BluetoothSocket::CreateBluetoothSocket(**i));
+ if (socket.get() != NULL) {
+ callback.Run(socket);
+ return;
+ }
}
}
callback.Run(NULL);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698