| Index: device/bluetooth/bluetooth_adapter_chromeos.cc
|
| diff --git a/device/bluetooth/bluetooth_adapter_chromeos.cc b/device/bluetooth/bluetooth_adapter_chromeos.cc
|
| index 68fb9ab36299ded74ac7988b78de7822034efefd..e69c479a77fe63c0a96faa5085b1efd95935c11e 100644
|
| --- a/device/bluetooth/bluetooth_adapter_chromeos.cc
|
| +++ b/device/bluetooth/bluetooth_adapter_chromeos.cc
|
| @@ -7,6 +7,7 @@
|
| #include <string>
|
|
|
| #include "base/bind.h"
|
| +#include "base/location.h"
|
| #include "base/logging.h"
|
| #include "base/metrics/histogram.h"
|
| #include "base/sequenced_task_runner.h"
|
| @@ -110,6 +111,12 @@ BluetoothAdapterChromeOS::~BluetoothAdapterChromeOS() {
|
| base::Bind(&OnUnregisterAgentError));
|
| }
|
|
|
| +void BluetoothAdapterChromeOS::DeleteOnCorrectThread() const {
|
| + if (ui_task_runner_->RunsTasksOnCurrentThread() ||
|
| + !ui_task_runner_->DeleteSoon(FROM_HERE, this))
|
| + delete this;
|
| +}
|
| +
|
| void BluetoothAdapterChromeOS::AddObserver(
|
| BluetoothAdapter::Observer* observer) {
|
| DCHECK(observer);
|
|
|