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

Unified Diff: device/bluetooth/bluetooth_low_energy_win.cc

Issue 2567903004: Replace ScopedVector/ScopedPtrHashMap with std::vector and std::unordered_map (Closed)
Patch Set: Mac bustage Created 4 years 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_low_energy_win.cc
diff --git a/device/bluetooth/bluetooth_low_energy_win.cc b/device/bluetooth/bluetooth_low_energy_win.cc
index 29abbad9eef86626b24e792fdd7cacd6d2078dbb..acd994b160d246f34520fc4e7b3f32f35ac8e880 100644
--- a/device/bluetooth/bluetooth_low_energy_win.cc
+++ b/device/bluetooth/bluetooth_low_energy_win.cc
@@ -372,7 +372,7 @@ bool CollectBluetoothLowEnergyDeviceStatus(
bool CollectBluetoothLowEnergyDeviceServices(
const base::FilePath& device_path,
- ScopedVector<BluetoothLowEnergyServiceInfo>* services,
+ std::vector<std::unique_ptr<BluetoothLowEnergyServiceInfo>>* services,
std::string* error) {
base::File file(device_path, base::File::FLAG_OPEN | base::File::FLAG_READ);
if (!file.IsValid()) {
@@ -408,11 +408,11 @@ bool CollectBluetoothLowEnergyDeviceServices(
for (USHORT i = 0; i < actual_length; ++i) {
BTH_LE_GATT_SERVICE& gatt_service(gatt_services.get()[i]);
- BluetoothLowEnergyServiceInfo* service_info =
- new BluetoothLowEnergyServiceInfo();
+ std::unique_ptr<BluetoothLowEnergyServiceInfo> service_info(
+ new BluetoothLowEnergyServiceInfo());
service_info->uuid = gatt_service.ServiceUuid;
service_info->attribute_handle = gatt_service.AttributeHandle;
- services->push_back(service_info);
+ services->push_back(std::move(service_info));
}
return true;
@@ -542,7 +542,7 @@ HRESULT OpenBluetoothLowEnergyDevices(GUID device_interface_guid,
// Gatt service devices.
bool EnumerateKnownBLEOrBLEGattServiceDevices(
GUID guid,
- ScopedVector<BluetoothLowEnergyDeviceInfo>* devices,
+ std::vector<std::unique_ptr<BluetoothLowEnergyDeviceInfo>>* devices,
std::string* error) {
ScopedDeviceInfoSetHandle info_set_handle;
HRESULT hr = OpenBluetoothLowEnergyDevices(guid, &info_set_handle);
@@ -678,7 +678,7 @@ bool BluetoothLowEnergyWrapper::IsBluetoothLowEnergySupported() {
}
bool BluetoothLowEnergyWrapper::EnumerateKnownBluetoothLowEnergyDevices(
- ScopedVector<BluetoothLowEnergyDeviceInfo>* devices,
+ std::vector<std::unique_ptr<BluetoothLowEnergyDeviceInfo>>* devices,
std::string* error) {
if (!IsBluetoothLowEnergySupported()) {
*error = kPlatformNotSupported;
@@ -691,7 +691,7 @@ bool BluetoothLowEnergyWrapper::EnumerateKnownBluetoothLowEnergyDevices(
bool BluetoothLowEnergyWrapper::
EnumerateKnownBluetoothLowEnergyGattServiceDevices(
- ScopedVector<BluetoothLowEnergyDeviceInfo>* devices,
+ std::vector<std::unique_ptr<BluetoothLowEnergyDeviceInfo>>* devices,
std::string* error) {
if (!IsBluetoothLowEnergySupported()) {
*error = kPlatformNotSupported;
@@ -704,7 +704,7 @@ bool BluetoothLowEnergyWrapper::
bool BluetoothLowEnergyWrapper::EnumerateKnownBluetoothLowEnergyServices(
const base::FilePath& device_path,
- ScopedVector<BluetoothLowEnergyServiceInfo>* services,
+ std::vector<std::unique_ptr<BluetoothLowEnergyServiceInfo>>* services,
std::string* error) {
if (!IsBluetoothLowEnergySupported()) {
*error = kPlatformNotSupported;

Powered by Google App Engine
This is Rietveld 408576698