Index: device/bluetooth/bluetooth_socket_chromeos.h |
diff --git a/device/bluetooth/bluetooth_socket_chromeos.h b/device/bluetooth/bluetooth_socket_chromeos.h |
index d4a56b598e283f31862980bc20975b974742fc5d..640292e14cd865e3aff05b54e2e621e0fa5f6159 100644 |
--- a/device/bluetooth/bluetooth_socket_chromeos.h |
+++ b/device/bluetooth/bluetooth_socket_chromeos.h |
@@ -26,8 +26,6 @@ |
namespace chromeos { |
class BluetoothDeviceChromeOS; |
-class BluetoothAdapterChromeOS; |
-class BluetoothAdapterProfileChromeOS; |
// The BluetoothSocketChromeOS class implements BluetoothSocket for the |
// Chrome OS platform. |
@@ -77,6 +75,9 @@ |
void Accept(const AcceptCompletionCallback& success_callback, |
const ErrorCompletionCallback& error_callback) override; |
+ // Returns the object path of the socket. |
+ const dbus::ObjectPath& object_path() const { return object_path_; } |
+ |
protected: |
~BluetoothSocketChromeOS() override; |
@@ -86,13 +87,12 @@ |
scoped_refptr<device::BluetoothSocketThread> socket_thread); |
// Register the underlying profile client object with the Bluetooth Daemon. |
- void RegisterProfile(BluetoothAdapterChromeOS* adapter, |
- const base::Closure& success_callback, |
+ void RegisterProfile(const base::Closure& success_callback, |
const ErrorCompletionCallback& error_callback); |
void OnRegisterProfile(const base::Closure& success_callback, |
- const ErrorCompletionCallback& error_callback, |
- BluetoothAdapterProfileChromeOS* profile); |
+ const ErrorCompletionCallback& error_callback); |
void OnRegisterProfileError(const ErrorCompletionCallback& error_callback, |
+ const std::string& error_name, |
const std::string& error_message); |
// Called by dbus:: on completion of the ConnectProfile() method. |
@@ -107,8 +107,9 @@ |
// Called by dbus:: on completion of the RegisterProfile() method call |
// triggered as a result of the adapter becoming present again. |
- void OnInternalRegisterProfile(BluetoothAdapterProfileChromeOS* profile); |
- void OnInternalRegisterProfileError(const std::string& error_message); |
+ void OnInternalRegisterProfile(); |
+ void OnInternalRegisterProfileError(const std::string& error_name, |
+ const std::string& error_message); |
// BluetoothProfileServiceProvider::Delegate: |
void Released() override; |
@@ -150,11 +151,13 @@ |
// Unregister the underlying profile client object from the Bluetooth Daemon. |
void UnregisterProfile(); |
- |
- // Releases the profile after the delegate is gone. |
- void ReleaseProfile(); |
- |
- // Adapter the profile is registered against |
+ void OnUnregisterProfile(const dbus::ObjectPath& object_path); |
+ void OnUnregisterProfileError(const dbus::ObjectPath& object_path, |
+ const std::string& error_name, |
+ const std::string& error_message); |
+ |
+ // Adapter the profile is registered against; this is only present when the |
+ // socket is listening. |
scoped_refptr<device::BluetoothAdapter> adapter_; |
// Address and D-Bus object path of the device being connected to, empty and |
@@ -168,8 +171,12 @@ |
// Copy of the profile options used for registering the profile. |
scoped_ptr<BluetoothProfileManagerClient::Options> options_; |
- // The profile registered with the adapter for this socket. |
- BluetoothAdapterProfileChromeOS* profile_; |
+ // Object path of the local profile D-Bus object. |
+ dbus::ObjectPath object_path_; |
+ |
+ // Local profile D-Bus object used for receiving profile delegate methods |
+ // from BlueZ. |
+ scoped_ptr<BluetoothProfileServiceProvider> profile_; |
// Pending request to an Accept() call. |
struct AcceptRequest { |