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

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

Issue 2865383002: PostTask MaybeReleaseAdapter in BluetoothEventRouter::AdapterDiscoveringChanged (Closed)
Patch Set: Created 3 years, 7 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 dbb238500d17de611b22e870d5adac559b92e9c1..ec6da6f3c473849ed82ea6950c0d21b20dd7ec3d 100644
--- a/extensions/browser/api/bluetooth/bluetooth_event_router.cc
+++ b/extensions/browser/api/bluetooth/bluetooth_event_router.cc
@@ -330,8 +330,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