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

Side by Side Diff: device/bluetooth/bluetooth_low_energy_win.cc

Issue 424093004: Improve processing of Bluetooth device discovery on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address code review feedback (nits and memory leak). Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/bluetooth/bluetooth_low_energy_win.h" 5 #include "device/bluetooth/bluetooth_low_energy_win.h"
6 6
7 #include "base/files/file.h" 7 #include "base/files/file.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "base/win/scoped_handle.h" 10 #include "base/win/scoped_handle.h"
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 return true; 645 return true;
646 case kError: 646 case kError:
647 return false; 647 return false;
648 case kOk: 648 case kOk:
649 devices->push_back(device_info.release()); 649 devices->push_back(device_info.release());
650 } 650 }
651 } 651 }
652 } 652 }
653 653
654 bool EnumerateKnownBluetoothLowEnergyServices( 654 bool EnumerateKnownBluetoothLowEnergyServices(
655 BluetoothLowEnergyDeviceInfo* device_info, 655 const base::FilePath& device_path,
656 ScopedVector<BluetoothLowEnergyServiceInfo>* services, 656 ScopedVector<BluetoothLowEnergyServiceInfo>* services,
657 std::string* error) { 657 std::string* error) {
658 return CollectBluetoothLowEnergyDeviceServices( 658 if (!IsBluetoothLowEnergySupported()) {
659 device_info->path, services, error); 659 *error = kPlatformNotSupported;
660 return false;
661 }
662
663 return CollectBluetoothLowEnergyDeviceServices(device_path, services, error);
660 } 664 }
661 665
662 bool ExtractBluetoothAddressFromDeviceInstanceIdForTesting( 666 bool ExtractBluetoothAddressFromDeviceInstanceIdForTesting(
663 const std::string& instance_id, 667 const std::string& instance_id,
664 BLUETOOTH_ADDRESS* btha, 668 BLUETOOTH_ADDRESS* btha,
665 std::string* error) { 669 std::string* error) {
666 return ExtractBluetoothAddressFromDeviceInstanceId(instance_id, btha, error); 670 return ExtractBluetoothAddressFromDeviceInstanceId(instance_id, btha, error);
667 } 671 }
668 672
669 } // namespace win 673 } // namespace win
670 } // namespace device 674 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_low_energy_win.h ('k') | device/bluetooth/bluetooth_service_record_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698