| Index: device/bluetooth/bluetooth_adapter_bluez.h
|
| diff --git a/device/bluetooth/bluetooth_adapter_chromeos.h b/device/bluetooth/bluetooth_adapter_bluez.h
|
| similarity index 84%
|
| rename from device/bluetooth/bluetooth_adapter_chromeos.h
|
| rename to device/bluetooth/bluetooth_adapter_bluez.h
|
| index aa1cda4c2a5c84b487a27c82cb5a1f78ed42acf8..53bf005afcadfd0ee3572cc0467e82e8c83538af 100644
|
| --- a/device/bluetooth/bluetooth_adapter_chromeos.h
|
| +++ b/device/bluetooth/bluetooth_adapter_bluez.h
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_
|
| -#define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_
|
| +#ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_BLUEZ_H_
|
| +#define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_BLUEZ_H_
|
|
|
| #include <map>
|
| #include <queue>
|
| @@ -33,17 +33,17 @@ namespace device {
|
| class BluetoothSocketThread;
|
| } // namespace device
|
|
|
| -namespace chromeos {
|
| +namespace bluez {
|
|
|
| -class BluetoothChromeOSTest;
|
| -class BluetoothAdapterProfileChromeOS;
|
| -class BluetoothDeviceChromeOS;
|
| -class BluetoothPairingChromeOS;
|
| -class BluetoothRemoteGattCharacteristicChromeOS;
|
| -class BluetoothRemoteGattDescriptorChromeOS;
|
| -class BluetoothRemoteGattServiceChromeOS;
|
| +class BluetoothBlueZTest;
|
| +class BluetoothAdapterProfileBlueZ;
|
| +class BluetoothDeviceBlueZ;
|
| +class BluetoothPairingBlueZ;
|
| +class BluetoothRemoteGattCharacteristicBlueZ;
|
| +class BluetoothRemoteGattDescriptorBlueZ;
|
| +class BluetoothRemoteGattServiceBlueZ;
|
|
|
| -// The BluetoothAdapterChromeOS class implements BluetoothAdapter for the
|
| +// The BluetoothAdapterBlueZ class implements BluetoothAdapter for the
|
| // Chrome OS platform.
|
| //
|
| // All methods are called from the dbus origin / UI thread and are generally
|
| @@ -52,13 +52,13 @@ class BluetoothRemoteGattServiceChromeOS;
|
| // This class interacts with sockets using the BluetoothSocketThread to ensure
|
| // single-threaded calls, and posts tasks to the UI thread.
|
| //
|
| -// Methods tolerate a shutdown scenario where BluetoothAdapterChromeOS::Shutdown
|
| +// Methods tolerate a shutdown scenario where BluetoothAdapterBlueZ::Shutdown
|
| // causes IsPresent to return false just before the dbus system is shutdown but
|
| -// while references to the BluetoothAdapterChromeOS object still exists.
|
| +// while references to the BluetoothAdapterBlueZ object still exists.
|
| //
|
| // When adding methods to this class verify shutdown behavior in
|
| -// BluetoothChromeOSTest, Shutdown.
|
| -class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS
|
| +// BluetoothBlueZTest, Shutdown.
|
| +class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterBlueZ
|
| : public device::BluetoothAdapter,
|
| public bluez::BluetoothAdapterClient::Observer,
|
| public bluez::BluetoothDeviceClient::Observer,
|
| @@ -67,7 +67,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS
|
| public:
|
| typedef base::Callback<void(const std::string& error_message)>
|
| ErrorCompletionCallback;
|
| - typedef base::Callback<void(BluetoothAdapterProfileChromeOS* profile)>
|
| + typedef base::Callback<void(BluetoothAdapterProfileBlueZ* profile)>
|
| ProfileRegisteredCallback;
|
|
|
| static base::WeakPtr<BluetoothAdapter> CreateAdapter();
|
| @@ -112,32 +112,31 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS
|
|
|
| // Locates the device object by object path (the devices map and
|
| // BluetoothDevice methods are by address).
|
| - BluetoothDeviceChromeOS* GetDeviceWithPath(
|
| - const dbus::ObjectPath& object_path);
|
| + BluetoothDeviceBlueZ* GetDeviceWithPath(const dbus::ObjectPath& object_path);
|
|
|
| // Announces to observers a change in device state that is not reflected by
|
| // its D-Bus properties. |device| is owned by the caller and cannot be NULL.
|
| - void NotifyDeviceChanged(BluetoothDeviceChromeOS* device);
|
| + void NotifyDeviceChanged(BluetoothDeviceBlueZ* device);
|
|
|
| // The following methods are used to send various GATT observer events to
|
| // observers.
|
| - void NotifyGattServiceAdded(BluetoothRemoteGattServiceChromeOS* service);
|
| - void NotifyGattServiceRemoved(BluetoothRemoteGattServiceChromeOS* service);
|
| - void NotifyGattServiceChanged(BluetoothRemoteGattServiceChromeOS* service);
|
| - void NotifyGattDiscoveryComplete(BluetoothRemoteGattServiceChromeOS* service);
|
| + void NotifyGattServiceAdded(BluetoothRemoteGattServiceBlueZ* service);
|
| + void NotifyGattServiceRemoved(BluetoothRemoteGattServiceBlueZ* service);
|
| + void NotifyGattServiceChanged(BluetoothRemoteGattServiceBlueZ* service);
|
| + void NotifyGattDiscoveryComplete(BluetoothRemoteGattServiceBlueZ* service);
|
| void NotifyGattCharacteristicAdded(
|
| - BluetoothRemoteGattCharacteristicChromeOS* characteristic);
|
| + BluetoothRemoteGattCharacteristicBlueZ* characteristic);
|
| void NotifyGattCharacteristicRemoved(
|
| - BluetoothRemoteGattCharacteristicChromeOS* characteristic);
|
| + BluetoothRemoteGattCharacteristicBlueZ* characteristic);
|
| void NotifyGattDescriptorAdded(
|
| - BluetoothRemoteGattDescriptorChromeOS* descriptor);
|
| + BluetoothRemoteGattDescriptorBlueZ* descriptor);
|
| void NotifyGattDescriptorRemoved(
|
| - BluetoothRemoteGattDescriptorChromeOS* descriptor);
|
| + BluetoothRemoteGattDescriptorBlueZ* descriptor);
|
| void NotifyGattCharacteristicValueChanged(
|
| - BluetoothRemoteGattCharacteristicChromeOS* characteristic,
|
| + BluetoothRemoteGattCharacteristicBlueZ* characteristic,
|
| const std::vector<uint8>& value);
|
| void NotifyGattDescriptorValueChanged(
|
| - BluetoothRemoteGattDescriptorChromeOS* descriptor,
|
| + BluetoothRemoteGattDescriptorBlueZ* descriptor,
|
| const std::vector<uint8>& value);
|
|
|
| // Returns the object path of the adapter.
|
| @@ -148,7 +147,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS
|
| // If |device_path| is the empty string, incoming connections will be
|
| // assigned to |delegate|. When the profile is
|
| // successfully registered, |success_callback| will be called with a pointer
|
| - // to the profile which is managed by BluetoothAdapterChromeOS. On failure,
|
| + // to the profile which is managed by BluetoothAdapterBlueZ. On failure,
|
| // |error_callback| will be called.
|
| void UseProfile(const device::BluetoothUUID& uuid,
|
| const dbus::ObjectPath& device_path,
|
| @@ -159,7 +158,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS
|
|
|
| // Release use of a profile by a device.
|
| void ReleaseProfile(const dbus::ObjectPath& device_path,
|
| - BluetoothAdapterProfileChromeOS* profile);
|
| + BluetoothAdapterProfileBlueZ* profile);
|
|
|
| protected:
|
| // BluetoothAdapter:
|
| @@ -167,12 +166,12 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS
|
| device::BluetoothDevice::PairingDelegate* pairing_delegate) override;
|
|
|
| private:
|
| - friend class BluetoothChromeOSTest;
|
| - friend class BluetoothChromeOSTest_Shutdown_Test;
|
| - friend class BluetoothChromeOSTest_Shutdown_OnStartDiscovery_Test;
|
| - friend class BluetoothChromeOSTest_Shutdown_OnStartDiscoveryError_Test;
|
| - friend class BluetoothChromeOSTest_Shutdown_OnStopDiscovery_Test;
|
| - friend class BluetoothChromeOSTest_Shutdown_OnStopDiscoveryError_Test;
|
| + friend class BluetoothBlueZTest;
|
| + friend class BluetoothBlueZTest_Shutdown_Test;
|
| + friend class BluetoothBlueZTest_Shutdown_OnStartDiscovery_Test;
|
| + friend class BluetoothBlueZTest_Shutdown_OnStartDiscoveryError_Test;
|
| + friend class BluetoothBlueZTest_Shutdown_OnStopDiscovery_Test;
|
| + friend class BluetoothBlueZTest_Shutdown_OnStopDiscoveryError_Test;
|
|
|
| // typedef for callback parameters that are passed to AddDiscoverySession
|
| // and RemoveDiscoverySession. This is used to queue incoming requests while
|
| @@ -186,8 +185,8 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS
|
| typedef std::pair<base::Closure, ErrorCompletionCallback>
|
| RegisterProfileCompletionPair;
|
|
|
| - BluetoothAdapterChromeOS();
|
| - ~BluetoothAdapterChromeOS() override;
|
| + BluetoothAdapterBlueZ();
|
| + ~BluetoothAdapterBlueZ() override;
|
|
|
| // bluez::BluetoothAdapterClient::Observer override.
|
| void AdapterAdded(const dbus::ObjectPath& object_path) override;
|
| @@ -238,19 +237,19 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS
|
| void OnRequestDefaultAgentError(const std::string& error_name,
|
| const std::string& error_message);
|
|
|
| - // Called by BluetoothAudioSinkChromeOS on completion of registering an audio
|
| + // Called by BluetoothAudioSinkBlueZ on completion of registering an audio
|
| // sink.
|
| void OnRegisterAudioSink(
|
| const device::BluetoothAdapter::AcquiredCallback& callback,
|
| const device::BluetoothAudioSink::ErrorCallback& error_callback,
|
| scoped_refptr<device::BluetoothAudioSink> audio_sink);
|
|
|
| - // Internal method to obtain a BluetoothPairingChromeOS object for the device
|
| + // Internal method to obtain a BluetoothPairingBlueZ object for the device
|
| // with path |object_path|. Returns the existing pairing object if the device
|
| // already has one (usually an outgoing connection in progress) or a new
|
| // pairing object with the default pairing delegate if not. If no default
|
| // pairing object exists, NULL will be returned.
|
| - BluetoothPairingChromeOS* GetPairing(const dbus::ObjectPath& object_path);
|
| + BluetoothPairingBlueZ* GetPairing(const dbus::ObjectPath& object_path);
|
|
|
| // Set the tracked adapter to the one in |object_path|, this object will
|
| // subsequently operate on that adapter until it is removed.
|
| @@ -326,7 +325,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS
|
|
|
| // Called by dbus:: on completion of the D-Bus method to register a profile.
|
| void OnRegisterProfile(const device::BluetoothUUID& uuid,
|
| - scoped_ptr<BluetoothAdapterProfileChromeOS> profile);
|
| + scoped_ptr<BluetoothAdapterProfileBlueZ> profile);
|
|
|
| void SetProfileDelegate(
|
| const device::BluetoothUUID& uuid,
|
| @@ -338,7 +337,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS
|
| const std::string& error_name,
|
| const std::string& error_message);
|
|
|
| - // Called by BluetoothAdapterProfileChromeOS when no users of a profile
|
| + // Called by BluetoothAdapterProfileBlueZ when no users of a profile
|
| // remain.
|
| void RemoveProfile(const device::BluetoothUUID& uuid);
|
|
|
| @@ -380,7 +379,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS
|
| scoped_refptr<device::BluetoothSocketThread> socket_thread_;
|
|
|
| // The profiles we have registered with the bluetooth daemon.
|
| - std::map<device::BluetoothUUID, BluetoothAdapterProfileChromeOS*> profiles_;
|
| + std::map<device::BluetoothUUID, BluetoothAdapterProfileBlueZ*> profiles_;
|
|
|
| // Queue of delegates waiting for a profile to register.
|
| std::map<device::BluetoothUUID, std::vector<RegisterProfileCompletionPair>*>
|
| @@ -390,11 +389,11 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS
|
|
|
| // 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<BluetoothAdapterChromeOS> weak_ptr_factory_;
|
| + base::WeakPtrFactory<BluetoothAdapterBlueZ> weak_ptr_factory_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterChromeOS);
|
| + DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterBlueZ);
|
| };
|
|
|
| -} // namespace chromeos
|
| +} // namespace bluez
|
|
|
| -#endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_
|
| +#endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_BLUEZ_H_
|
|
|