Chromium Code Reviews| Index: device/bluetooth/bluetooth_adapter.h |
| diff --git a/device/bluetooth/bluetooth_adapter.h b/device/bluetooth/bluetooth_adapter.h |
| index 87734d24527bb7204accf9cad08fb5bf26b25397..da99bd87a3f1bd7597022ea839d430fae19b8793 100644 |
| --- a/device/bluetooth/bluetooth_adapter.h |
| +++ b/device/bluetooth/bluetooth_adapter.h |
| @@ -14,12 +14,14 @@ |
| #include "base/callback.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/weak_ptr.h" |
| +#include "device/bluetooth/bluetooth_advertisement.h" |
| #include "device/bluetooth/bluetooth_audio_sink.h" |
| #include "device/bluetooth/bluetooth_device.h" |
| #include "device/bluetooth/bluetooth_export.h" |
| namespace device { |
| +class BluetoothAdvertisement; |
| class BluetoothDiscoveryFilter; |
| class BluetoothDiscoverySession; |
| class BluetoothGattCharacteristic; |
| @@ -174,22 +176,26 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapter |
| // The ErrorCallback is used for methods that can fail in which case it is |
| // called, in the success case the callback is simply not called. |
| - typedef base::Closure ErrorCallback; |
| + using ErrorCallback = base::Closure; |
| // The InitCallback is used to trigger a callback after asynchronous |
| // initialization, if initialization is asynchronous on the platform. |
| - typedef base::Callback<void()> InitCallback; |
| - |
| - typedef base::Callback<void(scoped_ptr<BluetoothDiscoverySession>)> |
| - DiscoverySessionCallback; |
| - typedef std::vector<BluetoothDevice*> DeviceList; |
| - typedef std::vector<const BluetoothDevice*> ConstDeviceList; |
| - typedef base::Callback<void(scoped_refptr<BluetoothSocket>)> |
| - CreateServiceCallback; |
| - typedef base::Callback<void(const std::string& message)> |
| - CreateServiceErrorCallback; |
| - typedef base::Callback<void(scoped_refptr<BluetoothAudioSink>)> |
| - AcquiredCallback; |
| + using InitCallback = base::Callback<void()>; |
|
armansito
2015/04/24 23:24:05
Use base::Closure here.
|
| + |
| + using DiscoverySessionCallback = |
| + base::Callback<void(scoped_ptr<BluetoothDiscoverySession>)>; |
| + using DeviceList = std::vector<BluetoothDevice*>; |
| + using ConstDeviceList = std::vector<const BluetoothDevice*>; |
| + using CreateServiceCallback = |
| + base::Callback<void(scoped_refptr<BluetoothSocket>)>; |
| + using CreateServiceErrorCallback = |
| + base::Callback<void(const std::string& message)>; |
| + using AcquiredCallback = |
| + base::Callback<void(scoped_refptr<BluetoothAudioSink>)>; |
| + using CreateAdvertisementCallback = |
| + base::Callback<void(scoped_refptr<BluetoothAdvertisement>)>; |
| + using CreateAdvertisementErrorCallback = |
| + base::Callback<void(BluetoothAdvertisement::ErrorCode)>; |
|
armansito
2015/04/24 23:13:13
Now you have typedef below and using here... Were
rkc
2015/04/24 23:15:04
These would look really weird with 8 typedefs and
armansito
2015/04/24 23:24:05
Well now you have 10 usings here and 2 typedefs la
rkc
2015/04/24 23:29:59
Done.
|
| // Returns a weak pointer to a new adapter. For platforms with asynchronous |
| // initialization, the returned adapter will run the |init_callback| once |
| @@ -369,6 +375,13 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapter |
| const AcquiredCallback& callback, |
| const BluetoothAudioSink::ErrorCallback& error_callback) = 0; |
| + // Creates and registers an advertisement for broadcast over the LE channel. |
| + // The created advertisement will be returned via the success callback. |
| + virtual void RegisterAdvertisement( |
| + scoped_ptr<BluetoothAdvertisement::Data> advertisement_data, |
| + const CreateAdvertisementCallback& callback, |
| + const CreateAdvertisementErrorCallback& error_callback) = 0; |
| + |
| protected: |
| friend class base::RefCounted<BluetoothAdapter>; |
| friend class BluetoothDiscoverySession; |