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

Unified Diff: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h

Issue 418483003: device/bluetooth: Move GATT observer methods to BluetoothAdapter::Observer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h
diff --git a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h
index c7a169a4246dcf7537aba126321fe4702379b0c0..8445ad3cb0afcfa32af968d85d6928b532b122ea 100644
--- a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h
+++ b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h
@@ -46,9 +46,7 @@ class Extension;
// The BluetoothLowEnergyEventRouter is used by the bluetoothLowEnergy API to
// interface with the internal Bluetooth API in device/bluetooth.
class BluetoothLowEnergyEventRouter
- : public device::BluetoothAdapter::Observer,
- public device::BluetoothDevice::Observer,
- public device::BluetoothGattService::Observer {
+ : public device::BluetoothAdapter::Observer {
public:
explicit BluetoothLowEnergyEventRouter(content::BrowserContext* context);
virtual ~BluetoothLowEnergyEventRouter();
@@ -228,41 +226,37 @@ class BluetoothLowEnergyEventRouter
void SetAdapterForTesting(device::BluetoothAdapter* adapter);
// device::BluetoothAdapter::Observer overrides.
- virtual void DeviceAdded(device::BluetoothAdapter* adapter,
- device::BluetoothDevice* device) OVERRIDE;
- virtual void DeviceRemoved(device::BluetoothAdapter* adapter,
- device::BluetoothDevice* device) OVERRIDE;
-
- // device::BluetoothDevice::Observer overrides.
- virtual void GattServiceAdded(device::BluetoothDevice* device,
+ virtual void GattServiceAdded(device::BluetoothAdapter* adapter,
+ device::BluetoothDevice* device,
device::BluetoothGattService* service) OVERRIDE;
virtual void GattServiceRemoved(
+ device::BluetoothAdapter* adapter,
device::BluetoothDevice* device,
device::BluetoothGattService* service) OVERRIDE;
-
- // device::BluetoothGattService::Observer overrides.
virtual void GattDiscoveryCompleteForService(
+ device::BluetoothAdapter* adapter,
device::BluetoothGattService* service) OVERRIDE;
virtual void GattServiceChanged(
+ device::BluetoothAdapter* adapter,
device::BluetoothGattService* service) OVERRIDE;
virtual void GattCharacteristicAdded(
- device::BluetoothGattService* service,
+ device::BluetoothAdapter* adapter,
device::BluetoothGattCharacteristic* characteristic) OVERRIDE;
virtual void GattCharacteristicRemoved(
- device::BluetoothGattService* service,
+ device::BluetoothAdapter* adapter,
device::BluetoothGattCharacteristic* characteristic) OVERRIDE;
virtual void GattDescriptorAdded(
- device::BluetoothGattCharacteristic* characteristic,
+ device::BluetoothAdapter* adapter,
device::BluetoothGattDescriptor* descriptor) OVERRIDE;
virtual void GattDescriptorRemoved(
- device::BluetoothGattCharacteristic* characteristic,
+ device::BluetoothAdapter* adapter,
device::BluetoothGattDescriptor* descriptor) OVERRIDE;
virtual void GattCharacteristicValueChanged(
- device::BluetoothGattService* service,
+ device::BluetoothAdapter* adapter,
device::BluetoothGattCharacteristic* characteristic,
const std::vector<uint8>& value) OVERRIDE;
virtual void GattDescriptorValueChanged(
- device::BluetoothGattCharacteristic* characteristic,
+ device::BluetoothAdapter* adapter,
device::BluetoothGattDescriptor* descriptor,
const std::vector<uint8>& value) OVERRIDE;
@@ -394,12 +388,6 @@ class BluetoothLowEnergyEventRouter
InstanceIdMap chrc_id_to_service_id_;
InstanceIdMap desc_id_to_chrc_id_;
- // Sets of BluetoothDevice and BluetoothGattService objects that are being
- // observed, used to remove the BluetoothLowEnergyEventRouter as an observer
- // during clean up.
- std::set<std::string> observed_devices_;
- std::set<std::string> observed_gatt_services_;
-
// Pointer to the current BluetoothAdapter instance. This represents a local
// Bluetooth adapter of the system.
scoped_refptr<device::BluetoothAdapter> adapter_;

Powered by Google App Engine
This is Rietveld 408576698