Chromium Code Reviews| Index: device/bluetooth/bluetooth_adapter_profile_chromeos.cc |
| diff --git a/device/bluetooth/bluetooth_adapter_profile_chromeos.cc b/device/bluetooth/bluetooth_adapter_profile_chromeos.cc |
| index 2feff37aed352abdbf8c54b8f42ecd096f465639..a34e1236ea373860f382f3df1d93738b0e2a10be 100644 |
| --- a/device/bluetooth/bluetooth_adapter_profile_chromeos.cc |
| +++ b/device/bluetooth/bluetooth_adapter_profile_chromeos.cc |
| @@ -20,7 +20,7 @@ namespace chromeos { |
| // static |
| BluetoothAdapterProfileChromeOS* BluetoothAdapterProfileChromeOS::Register( |
| - BluetoothAdapterChromeOS* adapter, |
| + base::WeakPtr<BluetoothAdapterChromeOS> adapter, |
| const device::BluetoothUUID& uuid, |
| const BluetoothProfileManagerClient::Options& options, |
| const base::Closure& success_callback, |
| @@ -39,7 +39,7 @@ BluetoothAdapterProfileChromeOS* BluetoothAdapterProfileChromeOS::Register( |
| } |
| BluetoothAdapterProfileChromeOS::BluetoothAdapterProfileChromeOS( |
| - BluetoothAdapterChromeOS* adapter, |
| + base::WeakPtr<BluetoothAdapterChromeOS> adapter, |
| const device::BluetoothUUID& uuid) |
| : uuid_(uuid), adapter_(adapter), weak_ptr_factory_(this) { |
| std::string uuid_path; |
| @@ -54,6 +54,7 @@ BluetoothAdapterProfileChromeOS::BluetoothAdapterProfileChromeOS( |
| } |
| BluetoothAdapterProfileChromeOS::~BluetoothAdapterProfileChromeOS() { |
| + adapter_->RemoveProfile(uuid_); |
|
Ilya Sherman
2015/02/19 20:37:58
Using a weak pointer doesn't prevent this line fro
|
| profile_.reset(); |
|
Ilya Sherman
2015/02/19 20:37:58
This line should not be necessary in the destructo
Marie Janssen
2015/02/20 22:53:46
After refactoring the ownership, these aren't need
|
| } |