Chromium Code Reviews| Index: device/bluetooth/bluetooth_adapter_profile_chromeos.h |
| diff --git a/device/bluetooth/bluetooth_adapter_profile_chromeos.h b/device/bluetooth/bluetooth_adapter_profile_chromeos.h |
| index 5f1edc2ead5e57aa892079cac232e8b71460515c..699417b35363baafaecc08015d67059435dfa366 100644 |
| --- a/device/bluetooth/bluetooth_adapter_profile_chromeos.h |
| +++ b/device/bluetooth/bluetooth_adapter_profile_chromeos.h |
| @@ -21,6 +21,9 @@ namespace chromeos { |
| // profile for custom Bluetooth services managed by a BluetoothAdapter. |
| // Maintains a list of delegates which may serve the profile. |
| // One delegate is allowed for each device. |
| +// |
| +// BluetoothAdapterProfileChromeOS objects are owned by the |
| +// BluetoothAdapterChromeOS and allocated through Register() |
| class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterProfileChromeOS |
| : public chromeos::BluetoothProfileServiceProvider::Delegate { |
| public: |
| @@ -28,7 +31,6 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterProfileChromeOS |
| // options |options|. Returns a newly allocated pointer, or nullptr |
| // if there was a problem. |
| static BluetoothAdapterProfileChromeOS* Register( |
|
Ilya Sherman
2015/02/21 01:22:10
Optional: It would be nice if this returned a scop
|
| - BluetoothAdapterChromeOS* adapter, |
| const device::BluetoothUUID& uuid, |
| const BluetoothProfileManagerClient::Options& options, |
| const base::Closure& success_callback, |
| @@ -39,6 +41,9 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterProfileChromeOS |
| // The object path of the profile. |
| const dbus::ObjectPath& object_path() const { return object_path_; } |
| + // Returns the UUID of the profile |
| + const device::BluetoothUUID& uuid() const { return uuid_; } |
| + |
| // Add a delegate for a device associated with this profile. |
| // An empty |device_path| indicates a local listening service. |
| // Returns true if the delegate was set, and false if the |device_path| |
| @@ -55,8 +60,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterProfileChromeOS |
| size_t DelegateCount() const { return delegates_.size(); } |
| private: |
| - BluetoothAdapterProfileChromeOS(BluetoothAdapterChromeOS* adapter, |
| - const device::BluetoothUUID& uuid); |
| + BluetoothAdapterProfileChromeOS(const device::BluetoothUUID& uuid); |
| // BluetoothProfileServiceProvider::Delegate: |
| void Released() override; |
| @@ -86,9 +90,6 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterProfileChromeOS |
| // Profile dbus object for receiving profile method calls from BlueZ |
| scoped_ptr<BluetoothProfileServiceProvider> profile_; |
| - // Adapter that owns this profile. |
| - BluetoothAdapterChromeOS* adapter_; |
| - |
| // Note: This should remain the last member so it'll be destroyed and |
| // invalidate its weak pointers before any other members are destroyed. |
| base::WeakPtrFactory<BluetoothAdapterProfileChromeOS> weak_ptr_factory_; |