| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROMEOS_DBUS_BLUETOOTH_LE_ADVERTISEMENT_SERVICE_PROVIDER_H_ | 5 #ifndef CHROMEOS_DBUS_BLUETOOTH_LE_ADVERTISEMENT_SERVICE_PROVIDER_H_ |
| 6 #define CHROMEOS_DBUS_BLUETOOTH_LE_ADVERTISEMENT_SERVICE_PROVIDER_H_ | 6 #define CHROMEOS_DBUS_BLUETOOTH_LE_ADVERTISEMENT_SERVICE_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // This method will be called when the advertisement is unregistered from | 43 // This method will be called when the advertisement is unregistered from |
| 44 // the Bluetooth daemon, generally at shutdown or if the adapter goes away. | 44 // the Bluetooth daemon, generally at shutdown or if the adapter goes away. |
| 45 // It may be used to perform cleanup tasks. This corresponds to the | 45 // It may be used to perform cleanup tasks. This corresponds to the |
| 46 // org.bluez.LEAdvertisement1.Release method and is renamed to avoid a | 46 // org.bluez.LEAdvertisement1.Release method and is renamed to avoid a |
| 47 // conflict with base::Refcounted<T>. | 47 // conflict with base::Refcounted<T>. |
| 48 virtual void Released() = 0; | 48 virtual void Released() = 0; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 virtual ~BluetoothLEAdvertisementServiceProvider(); | 51 virtual ~BluetoothLEAdvertisementServiceProvider(); |
| 52 | 52 |
| 53 const dbus::ObjectPath& object_path() { return object_path_; } | |
| 54 | |
| 55 // Creates the instance where |bus| is the D-Bus bus connection to export | 53 // Creates the instance where |bus| is the D-Bus bus connection to export |
| 56 // the object onto, |object_path| is the object path that it should have | 54 // the object onto, |object_path| is the object path that it should have |
| 57 // and |delegate| is the object to which all method calls will be passed | 55 // and |delegate| is the object to which all method calls will be passed |
| 58 // and responses generated from. | 56 // and responses generated from. |
| 59 static scoped_ptr<BluetoothLEAdvertisementServiceProvider> Create( | 57 static BluetoothLEAdvertisementServiceProvider* Create( |
| 60 dbus::Bus* bus, | 58 dbus::Bus* bus, |
| 61 const dbus::ObjectPath& object_path, | 59 const dbus::ObjectPath& object_path, |
| 62 Delegate* delegate, | 60 Delegate* delegate, |
| 63 AdvertisementType type, | 61 AdvertisementType type, |
| 64 scoped_ptr<UUIDList> service_uuids, | 62 scoped_ptr<UUIDList> service_uuids, |
| 65 scoped_ptr<ManufacturerData> manufacturer_data, | 63 scoped_ptr<ManufacturerData> manufacturer_data, |
| 66 scoped_ptr<UUIDList> solicit_uuids, | 64 scoped_ptr<UUIDList> solicit_uuids, |
| 67 scoped_ptr<ServiceData> service_data); | 65 scoped_ptr<ServiceData> service_data); |
| 68 | 66 |
| 69 protected: | 67 protected: |
| 70 BluetoothLEAdvertisementServiceProvider(); | 68 BluetoothLEAdvertisementServiceProvider(); |
| 71 | 69 |
| 72 // D-Bus object path of object we are exporting, kept so we can unregister | |
| 73 // again in our destructor. | |
| 74 dbus::ObjectPath object_path_; | |
| 75 | |
| 76 private: | 70 private: |
| 77 DISALLOW_COPY_AND_ASSIGN(BluetoothLEAdvertisementServiceProvider); | 71 DISALLOW_COPY_AND_ASSIGN(BluetoothLEAdvertisementServiceProvider); |
| 78 }; | 72 }; |
| 79 | 73 |
| 80 } // namespace chromeos | 74 } // namespace chromeos |
| 81 | 75 |
| 82 #endif // CHROMEOS_DBUS_BLUETOOTH_LE_ADVERTISEMENT_SERVICE_PROVIDER_H_ | 76 #endif // CHROMEOS_DBUS_BLUETOOTH_LE_ADVERTISEMENT_SERVICE_PROVIDER_H_ |
| OLD | NEW |