Index: chromeos/dbus/bluetooth_le_advertisement_service_provider.cc |
diff --git a/chromeos/dbus/bluetooth_le_advertisement_service_provider.cc b/chromeos/dbus/bluetooth_le_advertisement_service_provider.cc |
index f6a4c44100363cca552856f0ae337a72e35fadaf..aa3f23451abeda172c40e26afb39f25b6d8329fa 100644 |
--- a/chromeos/dbus/bluetooth_le_advertisement_service_provider.cc |
+++ b/chromeos/dbus/bluetooth_le_advertisement_service_provider.cc |
@@ -37,6 +37,7 @@ |
: origin_thread_id_(base::PlatformThread::CurrentId()), |
bus_(bus), |
delegate_(delegate), |
+ object_path_(object_path), |
type_(type), |
service_uuids_(service_uuids.Pass()), |
manufacturer_data_(manufacturer_data.Pass()), |
@@ -48,7 +49,6 @@ |
VLOG(1) << "Creating Bluetooth Advertisement: " << object_path_.value(); |
- object_path_ = object_path; |
exported_object_ = bus_->GetExportedObject(object_path_); |
// Export Bluetooth Advertisement interface methods. |
@@ -358,6 +358,10 @@ |
// owns this one, and must outlive it. |
Delegate* delegate_; |
+ // D-Bus object path of object we are exporting, kept so we can unregister |
+ // again in our destructor. |
+ dbus::ObjectPath object_path_; |
+ |
// Advertisement data that needs to be provided to BlueZ when requested. |
AdvertisementType type_; |
scoped_ptr<UUIDList> service_uuids_; |
@@ -387,7 +391,7 @@ |
} |
// static |
-scoped_ptr<BluetoothLEAdvertisementServiceProvider> |
+BluetoothLEAdvertisementServiceProvider* |
BluetoothLEAdvertisementServiceProvider::Create( |
dbus::Bus* bus, |
const dbus::ObjectPath& object_path, |
@@ -398,12 +402,12 @@ |
scoped_ptr<UUIDList> solicit_uuids, |
scoped_ptr<ServiceData> service_data) { |
if (!DBusThreadManager::Get()->IsUsingStub(DBusClientBundle::BLUETOOTH)) { |
- return make_scoped_ptr(new BluetoothAdvertisementServiceProviderImpl( |
+ return new BluetoothAdvertisementServiceProviderImpl( |
bus, object_path, delegate, type, service_uuids.Pass(), |
- manufacturer_data.Pass(), solicit_uuids.Pass(), service_data.Pass())); |
+ manufacturer_data.Pass(), solicit_uuids.Pass(), service_data.Pass()); |
} else { |
- return make_scoped_ptr( |
- new FakeBluetoothLEAdvertisementServiceProvider(object_path, delegate)); |
+ return new FakeBluetoothLEAdvertisementServiceProvider(object_path, |
+ delegate); |
} |
} |