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

Unified Diff: device/bluetooth/bluetooth_adapter_mac.h

Issue 1216583003: Adding Hashed Address to BluetoothLowEnergyDeviceMac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@timeinfo
Patch Set: shortening a signature.. Created 5 years, 5 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
Index: device/bluetooth/bluetooth_adapter_mac.h
diff --git a/device/bluetooth/bluetooth_adapter_mac.h b/device/bluetooth/bluetooth_adapter_mac.h
index c611e14be1768ea3f2ab3b59474da5fac463288d..999bdc7ad69858eefb32a94a793254fef38c54ff 100644
--- a/device/bluetooth/bluetooth_adapter_mac.h
+++ b/device/bluetooth/bluetooth_adapter_mac.h
@@ -83,11 +83,6 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterMac
void ClassicDeviceFound(IOBluetoothDevice* device) override;
void ClassicDiscoveryStopped(bool unexpected) override;
- // BluetoothLowEnergyDiscoveryManagerMac::Observer override:
- void LowEnergyDeviceUpdated(CBPeripheral* peripheral,
- NSDictionary* advertisementData,
- int rssi) override;
-
// Registers that a new |device| has connected to the local host.
void DeviceConnected(IOBluetoothDevice* device);
@@ -125,10 +120,18 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterMac
// connected to the local host.
void ClassicDeviceAdded(IOBluetoothDevice* device);
- // Updates |devices_| to include the currently paired devices, as well as any
- // connected, but unpaired, devices. Notifies observers if any previously
- // paired or connected devices are no longer present.
- void UpdateDevices();
+ // BluetoothLowEnergyDiscoveryManagerMac::Observer override:
+ void LowEnergyDeviceUpdated(CBPeripheral* peripheral,
+ NSDictionary* advertisementData,
+ int rssi) override;
+
+ // Removes from |devices_| any previously paired, connected or seen devices
+ // which are no longer present. Notifies observers.
+ void RemoveTimedOutDevices();
+
+ // Updates |devices_| to include the currently paired devices and notifies
+ // observers.
+ void AddPairedDevices();
std::string address_;
std::string name_;
@@ -145,6 +148,11 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterMac
scoped_refptr<base::SequencedTaskRunner> ui_task_runner_;
+ // The length of time that must elapse since the last Inquiry response (on
+ // Classic devices) or call to BluetoothLowEnergyDevice::Update() (on Low
+ // Energy) before a discovered device is considered to be no longer available.
+ const static NSTimeInterval kDiscoveryTimeoutSec;
armansito 2015/07/07 19:07:21 Move this above member variable declarations, per
krstnmnlsn 2015/07/07 21:58:01 Done.
+
base::WeakPtrFactory<BluetoothAdapterMac> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterMac);

Powered by Google App Engine
This is Rietveld 408576698