diff options
Diffstat (limited to 'device/bluetooth/bluetooth_adapter_bluez.h')
-rw-r--r-- | device/bluetooth/bluetooth_adapter_bluez.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/device/bluetooth/bluetooth_adapter_bluez.h b/device/bluetooth/bluetooth_adapter_bluez.h index e2a07ff..4f847a5 100644 --- a/device/bluetooth/bluetooth_adapter_bluez.h +++ b/device/bluetooth/bluetooth_adapter_bluez.h @@ -73,7 +73,9 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterBlueZ typedef base::Callback<void(BluetoothAdapterProfileBlueZ* profile)> ProfileRegisteredCallback; - static base::WeakPtr<BluetoothAdapter> CreateAdapter(); + // Calls |init_callback| after a BluetoothAdapter is fully initialized. + static base::WeakPtr<BluetoothAdapter> CreateAdapter( + const InitCallback& init_callback); // BluetoothAdapter: void Shutdown() override; @@ -171,9 +173,13 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterBlueZ typedef std::pair<base::Closure, ErrorCompletionCallback> RegisterProfileCompletionPair; - BluetoothAdapterBlueZ(); + explicit BluetoothAdapterBlueZ(const InitCallback& init_callback); ~BluetoothAdapterBlueZ() override; + // Init will get asynchronouly called once we know if Object Manager is + // supported. + void Init(); + // bluez::BluetoothAdapterClient::Observer override. void AdapterAdded(const dbus::ObjectPath& object_path) override; void AdapterRemoved(const dbus::ObjectPath& object_path) override; @@ -333,6 +339,10 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterBlueZ // ended (with either success or failure). void ProcessQueuedDiscoveryRequests(); + InitCallback init_callback_; + + bool initialized_; + // Set in |Shutdown()|, makes IsPresent()| return false. bool dbus_is_shutdown_; |