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

Unified Diff: device/bluetooth/bluetooth_low_energy_device_mac.mm

Issue 2912613002: bluetooth: macOS: Adding device namespace for all bluetooth_low_energy_device_mac.mm (Closed)
Patch Set: Merge Created 3 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_low_energy_device_mac.mm
diff --git a/device/bluetooth/bluetooth_low_energy_device_mac.mm b/device/bluetooth/bluetooth_low_energy_device_mac.mm
index 8e730550b4f26c2f9ad01d7dd1a405770ad60f57..e80b9c5192c18e7fee04b2b9193c473fd7d1367b 100644
--- a/device/bluetooth/bluetooth_low_energy_device_mac.mm
+++ b/device/bluetooth/bluetooth_low_energy_device_mac.mm
@@ -20,8 +20,7 @@
#include "device/bluetooth/bluetooth_remote_gatt_descriptor_mac.h"
#include "device/bluetooth/bluetooth_remote_gatt_service_mac.h"
-using device::BluetoothDevice;
-using device::BluetoothLowEnergyDeviceMac;
+namespace device {
BluetoothLowEnergyDeviceMac::BluetoothLowEnergyDeviceMac(
BluetoothAdapterMac* adapter,
@@ -184,7 +183,7 @@ void BluetoothLowEnergyDeviceMac::ConnectToService(
}
void BluetoothLowEnergyDeviceMac::ConnectToServiceInsecurely(
- const device::BluetoothUUID& uuid,
+ const BluetoothUUID& uuid,
const ConnectToServiceCallback& callback,
const ConnectToServiceErrorCallback& error_callback) {
NOTIMPLEMENTED();
@@ -245,8 +244,8 @@ void BluetoothLowEnergyDeviceMac::DidDiscoverPrimaryServices(NSError* error) {
}
if (discovery_pending_count_ == 0) {
for (auto it = gatt_services_.begin(); it != gatt_services_.end(); ++it) {
- device::BluetoothRemoteGattService* gatt_service = it->second.get();
- device::BluetoothRemoteGattServiceMac* gatt_service_mac =
+ BluetoothRemoteGattService* gatt_service = it->second.get();
+ BluetoothRemoteGattServiceMac* gatt_service_mac =
static_cast<BluetoothRemoteGattServiceMac*>(gatt_service);
gatt_service_mac->DiscoverCharacteristics();
}
@@ -442,7 +441,7 @@ void BluetoothLowEnergyDeviceMac::SendNotificationIfDiscoveryComplete() {
}
}
-device::BluetoothAdapterMac* BluetoothLowEnergyDeviceMac::GetMacAdapter() {
+BluetoothAdapterMac* BluetoothLowEnergyDeviceMac::GetMacAdapter() {
return static_cast<BluetoothAdapterMac*>(this->adapter_);
}
@@ -450,12 +449,12 @@ CBPeripheral* BluetoothLowEnergyDeviceMac::GetPeripheral() {
return peripheral_;
}
-device::BluetoothRemoteGattServiceMac*
+BluetoothRemoteGattServiceMac*
BluetoothLowEnergyDeviceMac::GetBluetoothRemoteGattServiceMac(
CBService* cb_service) const {
for (auto it = gatt_services_.begin(); it != gatt_services_.end(); ++it) {
- device::BluetoothRemoteGattService* gatt_service = it->second.get();
- device::BluetoothRemoteGattServiceMac* gatt_service_mac =
+ BluetoothRemoteGattService* gatt_service = it->second.get();
+ BluetoothRemoteGattServiceMac* gatt_service_mac =
static_cast<BluetoothRemoteGattServiceMac*>(gatt_service);
if (gatt_service_mac->GetService() == cb_service)
return gatt_service_mac;
@@ -463,14 +462,14 @@ BluetoothLowEnergyDeviceMac::GetBluetoothRemoteGattServiceMac(
return nullptr;
}
-device::BluetoothRemoteGattDescriptorMac*
+BluetoothRemoteGattDescriptorMac*
BluetoothLowEnergyDeviceMac::GetBluetoothRemoteGattDescriptorMac(
CBDescriptor* cb_descriptor) const {
CBCharacteristic* cb_characteristic = cb_descriptor.characteristic;
- device::BluetoothRemoteGattServiceMac* gatt_service =
+ BluetoothRemoteGattServiceMac* gatt_service =
GetBluetoothRemoteGattServiceMac(cb_characteristic.service);
DCHECK(gatt_service);
- device::BluetoothRemoteGattCharacteristicMac* gatt_characteristic =
+ BluetoothRemoteGattCharacteristicMac* gatt_characteristic =
gatt_service->GetBluetoothRemoteGattCharacteristicMac(cb_characteristic);
DCHECK(gatt_characteristic);
return gatt_characteristic->GetBluetoothRemoteGattDescriptorMac(
@@ -505,8 +504,6 @@ void BluetoothLowEnergyDeviceMac::DidDisconnectPeripheral(NSError* error) {
DidFailToConnectGatt(BluetoothDevice::ConnectErrorCode::ERROR_FAILED);
}
-namespace device {
-
std::ostream& operator<<(std::ostream& out,
const BluetoothLowEnergyDeviceMac& device) {
// TODO(crbug.com/703878): Should use
@@ -518,4 +515,5 @@ std::ostream& operator<<(std::ostream& out,
<< &device << ", " << is_gatt_connected << ", \""
<< name.value_or("Unnamed device") << "\">";
}
+
} // namespace device
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698