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

Unified Diff: device/bluetooth/bluetooth_device.h

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_device.h
diff --git a/device/bluetooth/bluetooth_device.h b/device/bluetooth/bluetooth_device.h
index 81021520b6501190cb165c7b32da3b2a4fedef77..efc509b7352a5a1278c7522797488cd28d54da43 100644
--- a/device/bluetooth/bluetooth_device.h
+++ b/device/bluetooth/bluetooth_device.h
@@ -24,13 +24,13 @@
#include "base/time/time.h"
#include "device/bluetooth/bluetooth_common.h"
#include "device/bluetooth/bluetooth_export.h"
+#include "device/bluetooth/bluetooth_remote_gatt_service.h"
#include "device/bluetooth/bluetooth_uuid.h"
namespace device {
class BluetoothAdapter;
class BluetoothGattConnection;
-class BluetoothRemoteGattService;
class BluetoothSocket;
class BluetoothUUID;
@@ -93,22 +93,20 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDevice {
NUM_CONNECT_ERROR_CODES // Keep as last enum.
};
- typedef std::vector<BluetoothUUID> UUIDList;
- typedef std::unordered_set<BluetoothUUID, BluetoothUUIDHash> UUIDSet;
- typedef std::unordered_map<BluetoothUUID,
- std::vector<uint8_t>,
- BluetoothUUIDHash>
- ServiceDataMap;
- typedef uint16_t ManufacturerId;
- typedef std::unordered_map<ManufacturerId, std::vector<uint8_t>>
- ManufacturerDataMap;
- typedef std::unordered_set<ManufacturerId> ManufacturerIDSet;
+ using UUIDList = std::vector<BluetoothUUID>;
+ using UUIDSet = std::unordered_set<BluetoothUUID, BluetoothUUIDHash>;
+ using ServiceDataMap = std::
+ unordered_map<BluetoothUUID, std::vector<uint8_t>, BluetoothUUIDHash>;
+ using ManufacturerId = uint16_t;
+ using ManufacturerDataMap =
+ std::unordered_map<ManufacturerId, std::vector<uint8_t>>;
+ using ManufacturerIDSet = std::unordered_set<ManufacturerId>;
// Mapping from the platform-specific GATT service identifiers to
// BluetoothRemoteGattService objects.
- typedef base::ScopedPtrHashMap<std::string,
- std::unique_ptr<BluetoothRemoteGattService>>
- GattServiceMap;
+ using GattServiceMap =
+ std::unordered_map<std::string,
+ std::unique_ptr<BluetoothRemoteGattService>>;
// Interface for negotiating pairing of bluetooth devices.
class PairingDelegate {
@@ -647,6 +645,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDevice {
GattServiceMap gatt_services_;
bool gatt_services_discovery_complete_;
+ bool gatt_services_shutting_down_;
// Received Signal Strength Indicator of the advertisement received.
base::Optional<int8_t> inquiry_rssi_;
@@ -673,6 +672,8 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDevice {
// Returns a localized string containing the device's bluetooth address and
// a device type for display when |name_| is empty.
base::string16 GetAddressWithLocalizedDeviceTypeName() const;
+
+ DISALLOW_COPY_AND_ASSIGN(BluetoothDevice);
};
} // namespace device

Powered by Google App Engine
This is Rietveld 408576698