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

Unified Diff: content/browser/bluetooth/bluetooth_dispatcher_host.cc

Issue 1898303003: bluetooth: Clean up WebBluetoothServiceImpl when adapter is removed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Re-enable tests Created 4 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 | content/browser/bluetooth/web_bluetooth_service_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/bluetooth/bluetooth_dispatcher_host.cc
diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.cc b/content/browser/bluetooth/bluetooth_dispatcher_host.cc
index 78d8c12391f6f614c079fccffdce789b86a95245..2c9a3eb4f04e2ef287131a7bb5c1b703a8290e1c 100644
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.cc
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.cc
@@ -483,6 +483,12 @@ void BluetoothDispatcherHost::set_adapter(
for (device::BluetoothAdapter::Observer* observer : adapter_observers_) {
adapter_->AddObserver(observer);
}
+ } else {
+ // Notify that the adapter has been removed and observers should clean up
+ // their state.
+ for (device::BluetoothAdapter::Observer* observer : adapter_observers_) {
+ observer->AdapterPresentChanged(nullptr, false);
+ }
}
}
« no previous file with comments | « no previous file | content/browser/bluetooth/web_bluetooth_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698