Index: device/bluetooth/bluetooth_device.h |
diff --git a/device/bluetooth/bluetooth_device.h b/device/bluetooth/bluetooth_device.h |
index 2d7f4b96d6991375155559beb44fb2ee72ea7b53..39086b28b6347ba541e4d572f24a6f49773f8d75 100644 |
--- a/device/bluetooth/bluetooth_device.h |
+++ b/device/bluetooth/bluetooth_device.h |
@@ -18,6 +18,7 @@ |
#include "base/gtest_prod_util.h" |
#include "base/memory/ref_counted.h" |
#include "base/strings/string16.h" |
+#include "base/time/time.h" |
#include "device/bluetooth/bluetooth_export.h" |
#include "device/bluetooth/bluetooth_uuid.h" |
#include "net/log/net_log.h" |
@@ -468,6 +469,12 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDevice { |
// empty string. |
static std::string CanonicalizeAddress(const std::string& address); |
+ // Return the timestamp for when this device was last seen. |
+ base::Time GetLastUpdateTime() const { return last_update_time_; } |
+ |
+ // Update the last time this device was seen. |
+ void UpdateTimestamp(); |
+ |
// Return associated BluetoothAdapter. |
BluetoothAdapter* GetAdapter() { return adapter_; } |
@@ -485,6 +492,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDevice { |
FRIEND_TEST_ALL_PREFIXES(BluetoothTest, |
BluetoothGattConnection_DisconnectGatt_Cleanup); |
FRIEND_TEST_ALL_PREFIXES(BluetoothTest, GetDeviceName_NullName); |
+ FRIEND_TEST_ALL_PREFIXES(BluetoothTest, RemoveOutdatedDevices); |
BluetoothDevice(BluetoothAdapter* adapter); |
@@ -550,6 +558,9 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDevice { |
// the specific data. The data is stored as BinaryValue. |
std::unique_ptr<base::DictionaryValue> services_data_; |
+ // Timestamp for when an advertisement was last seen. |
+ base::Time last_update_time_; |
+ |
private: |
// Returns a localized string containing the device's bluetooth address and |
// a device type for display when |name_| is empty. |