summaryrefslogtreecommitdiffstats
path: root/chromeos/dbus
diff options
context:
space:
mode:
Diffstat (limited to 'chromeos/dbus')
-rw-r--r--chromeos/dbus/fake_bluetooth_profile_manager_client.cc4
-rw-r--r--chromeos/dbus/fake_bluetooth_profile_service_provider.cc4
-rw-r--r--chromeos/dbus/fake_bluetooth_profile_service_provider.h28
3 files changed, 19 insertions, 17 deletions
diff --git a/chromeos/dbus/fake_bluetooth_profile_manager_client.cc b/chromeos/dbus/fake_bluetooth_profile_manager_client.cc
index d9910a4..bba54a87 100644
--- a/chromeos/dbus/fake_bluetooth_profile_manager_client.cc
+++ b/chromeos/dbus/fake_bluetooth_profile_manager_client.cc
@@ -48,7 +48,7 @@ void FakeBluetoothProfileManagerClient::RegisterProfile(
return;
}
- // check options for channel & psm
+ // TODO(jamuraa): check options for channel & psm
ServiceProviderMap::iterator iter = service_provider_map_.find(profile_path);
if (iter == service_provider_map_.end()) {
@@ -107,7 +107,7 @@ FakeBluetoothProfileManagerClient::GetProfileServiceProvider(
const std::string& uuid) {
ProfileMap::iterator iter = profile_map_.find(uuid);
if (iter == profile_map_.end())
- return NULL;
+ return nullptr;
return service_provider_map_[iter->second];
}
diff --git a/chromeos/dbus/fake_bluetooth_profile_service_provider.cc b/chromeos/dbus/fake_bluetooth_profile_service_provider.cc
index 95467f1..a1f44eb 100644
--- a/chromeos/dbus/fake_bluetooth_profile_service_provider.cc
+++ b/chromeos/dbus/fake_bluetooth_profile_service_provider.cc
@@ -31,8 +31,8 @@ FakeBluetoothProfileServiceProvider::~FakeBluetoothProfileServiceProvider() {
fake_bluetooth_profile_manager_client->UnregisterProfileServiceProvider(this);
}
-void FakeBluetoothProfileServiceProvider::Release() {
- VLOG(1) << object_path_.value() << ": Release";
+void FakeBluetoothProfileServiceProvider::Released() {
+ VLOG(1) << object_path_.value() << ": Released";
delegate_->Released();
}
diff --git a/chromeos/dbus/fake_bluetooth_profile_service_provider.h b/chromeos/dbus/fake_bluetooth_profile_service_provider.h
index 95a88c5..2c98048 100644
--- a/chromeos/dbus/fake_bluetooth_profile_service_provider.h
+++ b/chromeos/dbus/fake_bluetooth_profile_service_provider.h
@@ -18,28 +18,28 @@ namespace chromeos {
// FakeBluetoothProfileServiceProvider simulates the behavior of a local
// Bluetooth agent object and is used both in test cases in place of a
// mock and on the Linux desktop.
+//
+// This class is only called from the dbus origin thread and is not thread-safe.
class CHROMEOS_EXPORT FakeBluetoothProfileServiceProvider
: public BluetoothProfileServiceProvider {
public:
FakeBluetoothProfileServiceProvider(const dbus::ObjectPath& object_path,
- Delegate *delegate);
+ Delegate* delegate);
~FakeBluetoothProfileServiceProvider() override;
// Each of these calls the equivalent
// BluetoothProfileServiceProvider::Delegate method on the object passed on
// construction.
- virtual void Release();
- virtual void NewConnection(
- const dbus::ObjectPath& device_path,
- scoped_ptr<dbus::FileDescriptor> fd,
- const Delegate::Options& options,
- const Delegate::ConfirmationCallback& callback);
- virtual void RequestDisconnection(
- const dbus::ObjectPath& device_path,
- const Delegate::ConfirmationCallback& callback);
- virtual void Cancel();
-
- const dbus::ObjectPath& object_path() { return object_path_; }
+ void Released();
+ void NewConnection(const dbus::ObjectPath& device_path,
+ scoped_ptr<dbus::FileDescriptor> fd,
+ const Delegate::Options& options,
+ const Delegate::ConfirmationCallback& callback);
+ void RequestDisconnection(const dbus::ObjectPath& device_path,
+ const Delegate::ConfirmationCallback& callback);
+ void Cancel();
+
+ const dbus::ObjectPath& object_path() const { return object_path_; }
private:
friend class FakeBluetoothProfileManagerClient;
@@ -51,6 +51,8 @@ class CHROMEOS_EXPORT FakeBluetoothProfileServiceProvider
// passed to generate the reply. |delegate_| is generally the object that
// owns this one, and must outlive it.
Delegate* delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeBluetoothProfileServiceProvider);
};
} // namespace chromeos