Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2034)

Unified Diff: device/bluetooth/bluetooth_adapter_chromeos.cc

Issue 812673002: bluetooth: BluetoothAdapterDeleter used to control BluetoothAdapter destruction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: rebase Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/bluetooth_adapter_chromeos.h ('k') | device/bluetooth/bluetooth_adapter_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « device/bluetooth/bluetooth_adapter_chromeos.h ('k') | device/bluetooth/bluetooth_adapter_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698