| Index: device/bluetooth/bluetooth_adapter_profile_chromeos.h
|
| diff --git a/device/bluetooth/bluetooth_adapter_profile_chromeos.h b/device/bluetooth/bluetooth_adapter_profile_chromeos.h
|
| index 5f1edc2ead5e57aa892079cac232e8b71460515c..a23c9e345f46601b5f0bfb0dc3bd9e17830c5297 100644
|
| --- a/device/bluetooth/bluetooth_adapter_profile_chromeos.h
|
| +++ b/device/bluetooth/bluetooth_adapter_profile_chromeos.h
|
| @@ -28,7 +28,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterProfileChromeOS
|
| // options |options|. Returns a newly allocated pointer, or nullptr
|
| // if there was a problem.
|
| static BluetoothAdapterProfileChromeOS* Register(
|
| - BluetoothAdapterChromeOS* adapter,
|
| + base::WeakPtr<BluetoothAdapterChromeOS> adapter,
|
| const device::BluetoothUUID& uuid,
|
| const BluetoothProfileManagerClient::Options& options,
|
| const base::Closure& success_callback,
|
| @@ -55,8 +55,9 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterProfileChromeOS
|
| size_t DelegateCount() const { return delegates_.size(); }
|
|
|
| private:
|
| - BluetoothAdapterProfileChromeOS(BluetoothAdapterChromeOS* adapter,
|
| - const device::BluetoothUUID& uuid);
|
| + BluetoothAdapterProfileChromeOS(
|
| + base::WeakPtr<BluetoothAdapterChromeOS> adapter,
|
| + const device::BluetoothUUID& uuid);
|
|
|
| // BluetoothProfileServiceProvider::Delegate:
|
| void Released() override;
|
| @@ -87,7 +88,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterProfileChromeOS
|
| scoped_ptr<BluetoothProfileServiceProvider> profile_;
|
|
|
| // Adapter that owns this profile.
|
| - BluetoothAdapterChromeOS* adapter_;
|
| + base::WeakPtr<BluetoothAdapterChromeOS> adapter_;
|
|
|
| // Note: This should remain the last member so it'll be destroyed and
|
| // invalidate its weak pointers before any other members are destroyed.
|
|
|