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

Unified Diff: device/bluetooth/bluetooth_adapter_win.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_win.cc
diff --git a/device/bluetooth/bluetooth_adapter_win.cc b/device/bluetooth/bluetooth_adapter_win.cc
index db4e644533093d43c952a5d7df8ee581cf319fe3..9ad3af718c627dbdcdab9bb458762cb393eac6a6 100644
--- a/device/bluetooth/bluetooth_adapter_win.cc
+++ b/device/bluetooth/bluetooth_adapter_win.cc
@@ -8,6 +8,7 @@
#include <string>
#include <utility>
+#include "base/location.h"
#include "base/logging.h"
#include "base/sequenced_task_runner.h"
#include "base/single_thread_task_runner.h"
@@ -282,6 +283,11 @@ void BluetoothAdapterWin::DevicesPolled(
}
}
+void BluetoothAdapterWin::DeleteOnCorrectThread() const {
+ if (!ui_task_runner_->DeleteSoon(FROM_HERE, this))
+ delete this;
+}
+
// If the method is called when |discovery_status_| is DISCOVERY_STOPPING,
// starting again is handled by BluetoothAdapterWin::DiscoveryStopped().
void BluetoothAdapterWin::AddDiscoverySession(

Powered by Google App Engine
This is Rietveld 408576698