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

Unified Diff: extensions/browser/api/bluetooth/bluetooth_event_router.cc

Issue 2852773002: PostTask MaybeReleaseAdapter in BluetoothEventRouter::AdapterDiscoveringChanged (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/bluetooth/bluetooth_event_router.cc
diff --git a/extensions/browser/api/bluetooth/bluetooth_event_router.cc b/extensions/browser/api/bluetooth/bluetooth_event_router.cc
index 5524f5abd96d2a4b19a223dc8436e0fd07893375..a105e8cd11818fc362b59122cf054936d35f4ede 100644
--- a/extensions/browser/api/bluetooth/bluetooth_event_router.cc
+++ b/extensions/browser/api/bluetooth/bluetooth_event_router.cc
@@ -329,8 +329,11 @@ void BluetoothEventRouter::AdapterDiscoveringChanged(
DispatchAdapterStateEvent();
// Release the adapter after dispatching the event.
- if (!discovering)
- MaybeReleaseAdapter();
+ if (!discovering) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&BluetoothEventRouter::MaybeReleaseAdapter,
+ weak_ptr_factory_.GetWeakPtr()));
+ }
}
void BluetoothEventRouter::DeviceAdded(device::BluetoothAdapter* adapter,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698