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

Unified Diff: device/bluetooth/bluetooth_task_manager_win.h

Issue 2567903004: Replace ScopedVector/ScopedPtrHashMap with std::vector and std::unordered_map (Closed)
Patch Set: 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_task_manager_win.h
diff --git a/device/bluetooth/bluetooth_task_manager_win.h b/device/bluetooth/bluetooth_task_manager_win.h
index cf31f8474c7e5448d19867726f905d9ff2ef9f99..591b74afac9ccd973ba7b554976e089f76be9ea3 100644
--- a/device/bluetooth/bluetooth_task_manager_win.h
+++ b/device/bluetooth/bluetooth_task_manager_win.h
@@ -79,7 +79,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothTaskManagerWin
bool visible;
bool connected;
bool authenticated;
- ScopedVector<ServiceRecordState> service_record_states;
+ std::vector<std::unique_ptr<ServiceRecordState>> service_record_states;
// Properties specific to Bluetooth Classic devices.
uint32_t bluetooth_class;
// Properties specific to Bluetooth LE devices.
@@ -100,7 +100,8 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothTaskManagerWin
// the associated state can change over time. For example, during a
// discovery session, the "friendly" name may initially be "unknown" before
// the actual name is retrieved in subsequent poll events.
- virtual void DevicesPolled(const ScopedVector<DeviceState>& devices) {}
+ virtual void DevicesPolled(
+ const std::vector<std::unique_ptr<DeviceState>>& devices) {}
};
explicit BluetoothTaskManagerWin(
@@ -206,7 +207,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothTaskManagerWin
void OnAdapterStateChanged(const AdapterState* state);
void OnDiscoveryStarted(bool success);
void OnDiscoveryStopped();
- void OnDevicesPolled(const ScopedVector<DeviceState>* devices);
+ void OnDevicesPolled(const std::vector<std::unique_ptr<DeviceState>> devices);
// Called on BluetoothTaskRunner.
void StartPolling();
@@ -238,19 +239,21 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothTaskManagerWin
// exposed by those devices.
bool SearchDevices(int timeout_multiplier,
bool search_cached_devices_only,
- ScopedVector<DeviceState>* device_list);
+ std::vector<std::unique_ptr<DeviceState>>& device_list);
scheib 2016/12/13 00:51:06 pointers to containers
// Sends a device search API call to the adapter to look for Bluetooth Classic
// devices.
- bool SearchClassicDevices(int timeout_multiplier,
- bool search_cached_devices_only,
- ScopedVector<DeviceState>* device_list);
+ bool SearchClassicDevices(
+ int timeout_multiplier,
+ bool search_cached_devices_only,
+ std::vector<std::unique_ptr<DeviceState>>& device_list);
// Enumerate Bluetooth Low Energy devices.
- bool SearchLowEnergyDevices(ScopedVector<DeviceState>* device_list);
+ bool SearchLowEnergyDevices(
+ std::vector<std::unique_ptr<DeviceState>>& device_list);
// Discover services for the devices in |device_list|.
- bool DiscoverServices(ScopedVector<DeviceState>* device_list,
+ bool DiscoverServices(std::vector<std::unique_ptr<DeviceState>>& device_list,
bool search_cached_services_only);
// Discover Bluetooth Classic services for the given |device_address|.
@@ -258,7 +261,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothTaskManagerWin
const std::string& device_address,
const GUID& protocol_uuid,
bool search_cached_services_only,
- ScopedVector<ServiceRecordState>* service_record_states);
+ std::vector<std::unique_ptr<ServiceRecordState>>& service_record_states);
// Discover Bluetooth Classic services for the given |device_address|.
// Returns a Win32 error code.
@@ -266,18 +269,18 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothTaskManagerWin
const std::string& device_address,
const GUID& protocol_uuid,
bool search_cached_services_only,
- ScopedVector<ServiceRecordState>* service_record_states);
+ std::vector<std::unique_ptr<ServiceRecordState>>& service_record_states);
// Discover Bluetooth Low Energy services for the given |device_path|.
bool DiscoverLowEnergyDeviceServices(
const base::FilePath& device_path,
- ScopedVector<ServiceRecordState>* service_record_states);
+ std::vector<std::unique_ptr<ServiceRecordState>>& service_record_states);
// Search for device paths of the GATT services in |*service_record_states|
// from |device_address|.
bool SearchForGattServiceDevicePaths(
const std::string device_address,
- ScopedVector<ServiceRecordState>* service_record_states);
+ std::vector<std::unique_ptr<ServiceRecordState>>& service_record_states);
// GATT service related functions.
void GetGattIncludedCharacteristics(

Powered by Google App Engine
This is Rietveld 408576698