Index: chromeos/dbus/fake_bluetooth_profile_service_provider.cc |
diff --git a/chromeos/dbus/fake_bluetooth_profile_service_provider.cc b/chromeos/dbus/fake_bluetooth_profile_service_provider.cc |
index 999da6f8befdaa051d2b7a0f3f35e096de8e51a6..a0214645e6e7fa577b29a94c5c239da40a47b892 100644 |
--- a/chromeos/dbus/fake_bluetooth_profile_service_provider.cc |
+++ b/chromeos/dbus/fake_bluetooth_profile_service_provider.cc |
@@ -4,6 +4,8 @@ |
#include "chromeos/dbus/fake_bluetooth_profile_service_provider.h" |
+#include "chromeos/dbus/dbus_thread_manager.h" |
+#include "chromeos/dbus/fake_bluetooth_profile_manager_client.h" |
#include "dbus/object_path.h" |
namespace chromeos { |
@@ -14,10 +16,22 @@ FakeBluetoothProfileServiceProvider::FakeBluetoothProfileServiceProvider( |
: object_path_(object_path), |
delegate_(delegate) { |
VLOG(1) << "Creating Bluetooth Profile: " << object_path_.value(); |
+ |
+ FakeBluetoothProfileManagerClient* fake_bluetooth_profile_manager_client = |
+ static_cast<FakeBluetoothProfileManagerClient*>( |
+ DBusThreadManager::Get()-> |
+ GetExperimentalBluetoothProfileManagerClient()); |
+ fake_bluetooth_profile_manager_client->RegisterProfileServiceProvider(this); |
} |
FakeBluetoothProfileServiceProvider::~FakeBluetoothProfileServiceProvider() { |
VLOG(1) << "Cleaning up Bluetooth Profile: " << object_path_.value(); |
+ |
+ FakeBluetoothProfileManagerClient* fake_bluetooth_profile_manager_client = |
+ static_cast<FakeBluetoothProfileManagerClient*>( |
+ DBusThreadManager::Get()-> |
+ GetExperimentalBluetoothProfileManagerClient()); |
+ fake_bluetooth_profile_manager_client->UnregisterProfileServiceProvider(this); |
} |
void FakeBluetoothProfileServiceProvider::Release() { |
@@ -27,12 +41,12 @@ void FakeBluetoothProfileServiceProvider::Release() { |
void FakeBluetoothProfileServiceProvider::NewConnection( |
const dbus::ObjectPath& device_path, |
- dbus::FileDescriptor* fd, |
+ scoped_ptr<dbus::FileDescriptor> fd, |
const Delegate::Options& options, |
const Delegate::ConfirmationCallback& callback) { |
VLOG(1) << object_path_.value() << ": NewConnection for " |
<< device_path.value(); |
- delegate_->NewConnection(device_path, fd, options, callback); |
+ delegate_->NewConnection(device_path, fd.Pass(), options, callback); |
} |
void FakeBluetoothProfileServiceProvider::RequestDisconnection( |