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

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: Created 6 years 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
Index: device/bluetooth/bluetooth_adapter_chromeos.cc
diff --git a/device/bluetooth/bluetooth_adapter_chromeos.cc b/device/bluetooth/bluetooth_adapter_chromeos.cc
index 847299431fd04fedb82d229fd54bcd849fe43bd7..bde6152665370826962b2986906226ab63455038 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,11 @@ BluetoothAdapterChromeOS::~BluetoothAdapterChromeOS() {
base::Bind(&OnUnregisterAgentError));
}
+void BluetoothAdapterChromeOS::DeleteOnCorrectThread() const {
+ if (!ui_task_runner_->DeleteSoon(FROM_HERE, this))
+ delete this;
+}
+
void BluetoothAdapterChromeOS::AddObserver(
BluetoothAdapter::Observer* observer) {
DCHECK(observer);

Powered by Google App Engine
This is Rietveld 408576698