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

Unified Diff: device/bluetooth/bluetooth_low_energy_win.cc

Issue 2614753004: Remove ScopedVector from bluetooth. (Closed)
Patch Set: last win bits Created 3 years, 11 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 | « device/bluetooth/bluetooth_low_energy_win.h ('k') | device/bluetooth/bluetooth_low_energy_win_fake.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..53c5a39f9b1d084def0add8f6d4e787b062c040a 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,10 @@ 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();
+ auto service_info = base::MakeUnique<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 +541,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 +677,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 +690,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 +703,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;
« no previous file with comments | « device/bluetooth/bluetooth_low_energy_win.h ('k') | device/bluetooth/bluetooth_low_energy_win_fake.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698