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

Unified Diff: device/bluetooth/device.h

Issue 2404623002: bluetooth: Add DeviceChanged logging in Device service. (Closed)
Patch Set: Split JS into functions Created 4 years, 2 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/device.h
diff --git a/device/bluetooth/device.h b/device/bluetooth/device.h
index c82439e6c283ecb6e851e466061bedf060a18420..ed9b84e3bafb1d46af7698ce9180d5ea6a97863e 100644
--- a/device/bluetooth/device.h
+++ b/device/bluetooth/device.h
@@ -19,7 +19,7 @@ namespace bluetooth {
// device/bluetooth/public/interfaces/device.mojom.
// It handles requests to interact with Bluetooth Device.
// Uses the platform abstraction of device/bluetooth.
-class Device : public mojom::Device {
+class Device : public mojom::Device, public device::BluetoothAdapter::Observer {
public:
Device(const std::string& address,
scoped_refptr<device::BluetoothAdapter> adapter);
@@ -29,8 +29,13 @@ class Device : public mojom::Device {
static mojom::DeviceInfoPtr ConstructDeviceInfoStruct(
const device::BluetoothDevice* device);
+ // device::BluetoothAdapter::Observer overrides:
+ void DeviceChanged(device::BluetoothAdapter* adapter,
+ device::BluetoothDevice* device) override;
+
// mojom::Device overrides:
void GetInfo(const GetInfoCallback& callback) override;
+ void SetClient(mojom::GattClientPtr client) override;
private:
// The address of the Bluetooth device.
@@ -39,6 +44,9 @@ class Device : public mojom::Device {
// The current BluetoothAdapter.
scoped_refptr<device::BluetoothAdapter> adapter_;
+ // The current client which listens to events from this device.
+ mojom::GattClientPtr client_;
+
DISALLOW_COPY_AND_ASSIGN(Device);
};

Powered by Google App Engine
This is Rietveld 408576698