diff options
author | keybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-09 03:49:18 +0000 |
---|---|---|
committer | keybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-09 03:49:18 +0000 |
commit | e882d2cdf5ed5337d68f2b32ba0f885725ca8b3f (patch) | |
tree | c4ca06e4ad129b16aa1f04753db7ac4e98a55240 /chromeos/dbus/fake_bluetooth_profile_service_provider.cc | |
parent | dc5d179b1e34c9147630adc9d20e43e7986f7feb (diff) | |
download | chromium_src-e882d2cdf5ed5337d68f2b32ba0f885725ca8b3f.zip chromium_src-e882d2cdf5ed5337d68f2b32ba0f885725ca8b3f.tar.gz chromium_src-e882d2cdf5ed5337d68f2b32ba0f885725ca8b3f.tar.bz2 |
Bluetooth: Profile support for Chrome OS
Implement support for the BluetoothProfile API for the BlueZ 5.x
stack on Chrome OS, including BluetoothSocket support.
BUG=229636
TEST=device_unittests
Review URL: https://chromiumcodereview.appspot.com/14487002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199095 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/dbus/fake_bluetooth_profile_service_provider.cc')
-rw-r--r-- | chromeos/dbus/fake_bluetooth_profile_service_provider.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/chromeos/dbus/fake_bluetooth_profile_service_provider.cc b/chromeos/dbus/fake_bluetooth_profile_service_provider.cc index 999da6f..a021464 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( |